Are associative arrays stable in D?
Yota
yotaxp at thatGoogleMailThing.com
Wed Jul 17 10:21:03 PDT 2013
On Wednesday, 17 July 2013 at 09:48:06 UTC, monarch_dodra wrote:
> I find it disturbing that the built-in property "keys" would
> dup an entire array, and then copy all the keys into that
> array, whereas the function "byKeys()" will simply allow you to
> iterate on the keys.
>
> "keys" is in blatant violation of the "properties emulate
> members" mind-set.
My sentiments exactly. I feel it would also be more appropriate
to name it 'getKeys'.
I get the feeling that a lot of methods in Phobos use @property
just because they can, and it makes me itch when I come across
them. 'dup' and 'idup' are big offenders. Can't wait to get a
debugger that visualizes data, and tries to fetch both 'dup'
properties of a multi-megabyte array. Of course there's no way
to undo that now without breaking absolutely EVERYONE's code.
More information about the Digitalmars-d-learn
mailing list