Re: non-constant expression ["foo":5, "bar":10, "baz":2000]

2022-01-06 Thread bauss via Digitalmars-d-learn
On Thursday, 6 January 2022 at 16:01:40 UTC, HuskyNator wrote: On Thursday, 6 January 2022 at 13:33:24 UTC, bauss wrote: While not the exact same, there's a small work around here that can help in some cases: ```d immutable long[string] aa; shared static this() { aa = [ "foo": 5,

Re: non-constant expression ["foo":5, "bar":10, "baz":2000]

2022-01-06 Thread Tejas via Digitalmars-d-learn
On Thursday, 6 January 2022 at 16:01:09 UTC, Stefan Koch wrote: On Thursday, 6 January 2022 at 12:04:12 UTC, HuskyNator wrote: On Monday, 28 November 2016 at 14:41:44 UTC, Era Scarecrow wrote: On Monday, 28 November 2016 at 09:06:34 UTC, Paolo Invernizzi wrote: The point is that I was trying

Re: non-constant expression ["foo":5, "bar":10, "baz":2000]

2022-01-06 Thread HuskyNator via Digitalmars-d-learn
On Thursday, 6 January 2022 at 13:33:24 UTC, bauss wrote: While not the exact same, there's a small work around here that can help in some cases: ```d immutable long[string] aa; shared static this() { aa = [ "foo": 5, "bar": 10, "baz": 2000 ]; } ``` Thanks a lot!

Re: non-constant expression ["foo":5, "bar":10, "baz":2000]

2022-01-06 Thread Stefan Koch via Digitalmars-d-learn
On Thursday, 6 January 2022 at 12:04:12 UTC, HuskyNator wrote: On Monday, 28 November 2016 at 14:41:44 UTC, Era Scarecrow wrote: On Monday, 28 November 2016 at 09:06:34 UTC, Paolo Invernizzi wrote: The point is that I was trying to avoid some cycle between modules, detected by 2.072. This bug

Re: non-constant expression ["foo":5, "bar":10, "baz":2000]

2022-01-06 Thread bauss via Digitalmars-d-learn
On Thursday, 6 January 2022 at 12:04:12 UTC, HuskyNator wrote: On Monday, 28 November 2016 at 14:41:44 UTC, Era Scarecrow wrote: On Monday, 28 November 2016 at 09:06:34 UTC, Paolo Invernizzi wrote: The point is that I was trying to avoid some cycle between modules, detected by 2.072. This bug

Re: non-constant expression ["foo":5, "bar":10, "baz":2000]

2022-01-06 Thread HuskyNator via Digitalmars-d-learn
On Monday, 28 November 2016 at 14:41:44 UTC, Era Scarecrow wrote: On Monday, 28 November 2016 at 09:06:34 UTC, Paolo Invernizzi wrote: The point is that I was trying to avoid some cycle between modules, detected by 2.072. This bug leads to pollution in the use of static this only to workaround

Re: non-constant expression ["foo":5, "bar":10, "baz":2000]

2016-11-28 Thread Era Scarecrow via Digitalmars-d-learn
On Monday, 28 November 2016 at 09:06:34 UTC, Paolo Invernizzi wrote: The point is that I was trying to avoid some cycle between modules, detected by 2.072. This bug leads to pollution in the use of static this only to workaround the limitation... Wasn't someone working on a Associative Array

Re: non-constant expression ["foo":5, "bar":10, "baz":2000]

2016-11-28 Thread Paolo Invernizzi via Digitalmars-d-learn
On Sunday, 27 November 2016 at 22:25:51 UTC, John Colvin wrote: On Saturday, 26 November 2016 at 17:37:57 UTC, Paolo Invernizzi wrote: This is stated in documentation [1]: immutable long[string] aa = [ "foo": 5, "bar": 10, "baz": 2000 ]; unittest { assert(aa["foo"] == 5);

Re: non-constant expression ["foo":5, "bar":10, "baz":2000]

2016-11-27 Thread John Colvin via Digitalmars-d-learn
On Saturday, 26 November 2016 at 17:37:57 UTC, Paolo Invernizzi wrote: This is stated in documentation [1]: immutable long[string] aa = [ "foo": 5, "bar": 10, "baz": 2000 ]; unittest { assert(aa["foo"] == 5); assert(aa["bar"] == 10); assert(aa["baz"] == 2000); } But results

Re: non-constant expression ["foo":5, "bar":10, "baz":2000]

2016-11-27 Thread Paolo Invernizzi via Digitalmars-d-learn
On Saturday, 26 November 2016 at 19:57:21 UTC, Adam D. Ruppe wrote: On Saturday, 26 November 2016 at 17:37:57 UTC, Paolo Invernizzi wrote: This is stated in documentation [1]: What's the link? This is a known limitation, it has never worked. The docs should reflect that, though some day, it

Re: non-constant expression ["foo":5, "bar":10, "baz":2000]

2016-11-26 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 26 November 2016 at 17:37:57 UTC, Paolo Invernizzi wrote: This is stated in documentation [1]: What's the link? This is a known limitation, it has never worked. The docs should reflect that, though some day, it might start working.

non-constant expression ["foo":5, "bar":10, "baz":2000]

2016-11-26 Thread Paolo Invernizzi via Digitalmars-d-learn
This is stated in documentation [1]: immutable long[string] aa = [ "foo": 5, "bar": 10, "baz": 2000 ]; unittest { assert(aa["foo"] == 5); assert(aa["bar"] == 10); assert(aa["baz"] == 2000); } But results to: Error: non-constant expression ["foo":5L, "bar":10L,