[Issue 7177] $ should forward to length by default
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Mar 21 21:27:10 PDT 2013
http://d.puremagic.com/issues/show_bug.cgi?id=7177
--- Comment #37 from Jonathan M Davis <jmdavisProg at gmx.com> 2013-03-21 21:27:07 PDT ---
I think that having opDollar work with UFCS would set a bad precedent. That's
opening the door for 3rd party code to be able to overload operators on your
types, and I think that that's a pretty bad can of worms to open.
On the whole, I don't see a problem with length being aliased to opDollar if
opDollar isn't defined except for the case where you _don't_ want opDollar to
be defined, and I don't know if requiring that opDollar be explicitly disabled
in that case is a good idea or not.
If we don't implement this enhancement request though, I'm very much inclined
to put a note in the changelog (probably in red) which warns people that
hasSlicing will soon be requiring opDollar as will isRandomAccessRange for
finite ranges, so people should update their code to have opDollar (even if
it's just an alias to length) so that it doesn't break when we make the changes
in hasSlicing and isRandomAccess range in a release or two. That's not ideal,
but it would at least give people a chance to avoid the code breakage if
they're proactive.
--
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