On Mon, 12 Jul 2010 12:16:32 -0400, eris <jvbur...@gmail.com> wrote:
Just though I'd post here on something that made me question my sanity
late
one night.
I was working on some test code and for some reason put parens around
"myArray.reverse". After that the compiler complained that "reverse"
was an
unknown identifier. It took me about 30 minutes at 2am to finally give
up and
figure out I needed sleep.
The next morning after some google searching I noticed that everyone was
referring to the 'reverse' "property". That caught my eye. reverse
property?
Thats not a property, it's a method -- especially since it does an
in-place
modification of the object.
This must mean it's something I don't understand. The only thing I could
think of is that the "reverse" property is actually a boolean which
tells the
iterator which direction to traverse the data structure.
Your thought are appreciated.
reverse, sort, dup, idup, keys, etc. are all "properties" that were
present before genuine @properties were added to the language.
sort is all but deprecated, since std.algorithm.sort exists.
reverse could even more easily be implemented as a library function than
sort, it should be removed as well.
dup and idup have problems as builtins also, see this bug:
http://d.puremagic.com/issues/show_bug.cgi?id=3550. But that's not
because they are propertites. I personally don't think they should be
properties, but that's open to interpretation.
The only one I see there that is truly a property is keys.
-Steve