Revamping associative arrays

language_fan foo at bar.com.invalid
Sat Oct 17 12:25:26 PDT 2009


Sat, 17 Oct 2009 19:16:32 +0000, dsimcha thusly wrote:

> == Quote from Andrei Alexandrescu (SeeWebsiteForEmail at erdani.org)'s
> article
>> Associative arrays are today quite problematic because they don't offer
>> any true iteration. Furthermore, the .keys and .values properties
>> create new arrays, which is wasteful.
>> Another issue with associative arrays is that ++a[k] is hacked, which
>> reflects a grave language limitation. That needs to be replaced with a
>> true facility.
>> Any other issues with AAs that you want to see fixed, and ideas guiding
>> a redesign?
>> Thanks,
>> Andrei
> 
> I've thought about this a lot, here's a laundry list.

[snip]

It would be great if the underlying implementation could be switched 
based on the task at hand. The AAs could be completely library provided, 
with only a small built-in syntactical sugaring on top of it.



More information about the Digitalmars-d mailing list