How to make a global immutable associative array?

bearophile bearophileHUGS at lycos.com
Tue Mar 18 18:37:17 PDT 2014


Dan Killebrew:

> I meant something else. Why doesn't this work:
>
> immutable int[int] aa = [1:2,3:4];
>
> Seems like it should work to me. After all, this works:
>
> immutable int[] a = [1,2,3,4];
>
> So how is the second 'more constant' than the first? The fact 
> that the first code block does not compile seems like a bug.

If you meant defining directly the global associative arrays, 
it's a compiler/runtime limitation that will be removed. It's in 
Bugzilla since years.

Bye,
bearophile


More information about the Digitalmars-d mailing list