[Issue 6798] New: Integrate overloadings for multidimentional indexing and slicing
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sun Oct 9 17:35:45 PDT 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6798
Summary: Integrate overloadings for multidimentional indexing
and slicing
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: enhancement
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: k.hara.pg at gmail.com
--- Comment #0 from Kenji Hara <k.hara.pg at gmail.com> 2011-10-09 17:34:56 PDT ---
The following replacement has been proposed by issue 3474.
x[$-2, y[$-6, $-9], $-2]
// is translated to
// x.opIndex(x.opDollar!0 - 2,
// y.opIndex(y.opDollar!0 - 6, y.opDollar!1 - 9),
// x.opDollar!2 - 2)
Similarly, I propose the following replacement for the overloading mixture of
indexing and slicing.
x[2..$, $-1, y[$-6, 0..$]]
// is translated to
// x.opIndex(x.opSlice!0(2, x.opDollar!0),
// x.opDollar!1 - 1,
// y.opIndex(y.opDollar!0 - 6, y.opSlice!1(0, y.opDollar!1)))
And additionally, I propose to merge slicing into indexing.
x[]
// is translated to
// x.opIndex()
After all, the indexing and slicing getter will be translated to
x.opIndex(...), and the setter will be translated to x.opIndexAssign(value,
...).
And also, opSlice and opSliceAssign would be unnecessary.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list