Associative arrays
Ola Fosheim Grostad
ola.fosheim.grostad at gmail.com
Tue May 18 08:22:56 UTC 2021
On Tuesday, 18 May 2021 at 08:08:10 UTC, Chris Piker wrote:
> On Tuesday, 18 May 2021 at 07:50:06 UTC, Ola Fosheim Grostad
> wrote:
>> I hope it stays unimplemented. AAs should be replaced by a
>> library solution and AA literals should work with custom AAs.
>> The special casing is not good for metaprogramming.
>
> I'm new to D and don't come from a hard-core C++ background.
> On naive first take, the fact that D had a construct resembling
> python dictionaries made D more attractive. In fact, it was AAs
> that finally tipped me in favor of trying D.
>
> Can you tell me more about why AAs are an undesirable language
> feature?
Hashing strategies needs contextual knowledge. But that is not
the main reason. The main reason is that D needs better
metaprogramming. A hashmap literal should bind to any hashtable.
There is no reason to not make it a 100% library construct. Stuff
it into your runtime and you would hardly notice any difference.
Golden design rule: never add language features that can be done
as library constructs, ever.
More information about the Digitalmars-d
mailing list