Re: Mutable reference for immutable AA

2015-05-29 Thread Jack Applegame via Digitalmars-d-learn
I made trivial pull request - https://github.com/D-Programming-Language/phobos/pull/3341 RebindableAA!(immutable int[string]) aa = ["a": 1, "b": 2]; // works assert(aa["a"] == 1); // cool aa = ["a": 3, "b": 4]; // nice auto bb = aa; // yes bb = ["a": 4, "b": 5]; // super aa["a"] = 2

Mutable reference for immutable AA

2015-05-29 Thread Jack Applegame via Digitalmars-d-learn
I need mutable storage for immutable associative array. Just create new immutable AA and store it for future passing it between threads/fibers. First attempt: just immutable AA immutable aa = ["1":1, "2":1]; aa = ["1":1, "2":1]; // fail, can't assign a new AA Second attempt: mutable AA with im