associative arrays:

llee Larry at workingwondersus.com
Wed Oct 1 11:18:55 PDT 2008


Is there any reason why the following fails with an ArrayBoundsError error?

     import std.cstream;

     void main ()
     {
          string [string] array = ["name": "value"];
          dout.writefln ("value: %s", array ["name"]);
     }

I've been using the following work around, But I'm not sure why the above fails.

     ...
     string [string] array;
     array ["name"] = "value";
     ...

Can anyone explain this?



More information about the Digitalmars-d mailing list