Associative arrays with void values
Benji Smith
dlanguage at benjismith.net
Sun Apr 12 22:03:44 PDT 2009
dsimcha wrote:
> On the other hand, I'm not sure if it makes sense from a consistency perspective
> to have AAs as a builtin, first class type and sets as a library type. I'm not
> sure whether this argues more for AAs being a library type or sets being builtin,
> but the inconsistency is just weird.
Especially since an associative array should have a .keys property that
returns a set.
(Incidentally, I also think the natural set operations, like
intersection and mutual exclusion, are just as handy for maps as for sets.)
The natural conclusion is that AAs should be library types.
I like the fact that D provides literal syntax for AAs, but I think the
correct implementation is for the compiler to pass the values from those
literal expressions into a library type constructor.
--benji
More information about the Digitalmars-d
mailing list