[Issue 3474] PATCH: Implement opDollar for struct and class indexing operations

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Nov 6 02:24:31 PST 2009


http://d.puremagic.com/issues/show_bug.cgi?id=3474



--- Comment #5 from Sobirari Muhomori <dfj1esp02 at sneakemail.com> 2009-11-06 02:24:30 PST ---
> I agree that "opDollar" is a bad choice of name, but so is "length".  AIUI the
> point is for it to represent the end (or one past the end) of the array, rather
> than length.  They correspond only in the case of 0-based arrays.

It's elready defined semantics. $ means length. If you want different
semantics, use different means to express it. Objects in container can be
numbered from 1, numbering can have gaps, so $-1 can be meaningless, or entire
collection can be unordered like hashtable, so the last element can be
meaningless, or keytype can be of complex type, having nothing in common with
numbers, you just use different means to work with it.

-- 
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