Associative Arrays in the data segment

Steven Schveighoffer via Digitalmars-d digitalmars-d at puremagic.com
Fri Apr 10 06:17:48 PDT 2015


On 4/10/15 9:04 AM, ketmar wrote:
> On Fri, 10 Apr 2015 17:54:47 +1000, Daniel Murphy wrote:

>> It only works with integral types of at most 32-bits at the moment, but
>> most built-in types are fairly easy to support.  The downside is
>> requires re-implementing druntime's AA and hashing algorithms in the
>> compiler, and keeping them in sync when either changes.
>>

>
> this has a majour drawback, methinks: an inability to change AA
> implementation without fixing the compiler too. i.e. i can't no longer to
> simply rewrite the relevant parts of druntime (change hashing function,
> for example) and be happy.
>

I agree with ketmar, If the compiler implements this, then you cannot 
play with the implementation of AA at all without changing the compiler.

I'd rather see the compiler treat AA as fully library type, and be able 
to build AA at compile time because the code is sane.

-Steve


More information about the Digitalmars-d mailing list