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: Module without object file?

2022-01-06 Thread kdevel via Digitalmars-d-learn
On Thursday, 6 January 2022 at 02:47:17 UTC, Steven Schveighoffer wrote: Possibly. You see, you are importing another module. Since you are doing that, the module must participate in cycle detection at the beginning of running the program. IC. Had cyclic module dependencies twice within this p

Re: Module without object file?

2022-01-06 Thread kdevel via Digitalmars-d-learn
On Thursday, 6 January 2022 at 02:37:41 UTC, frame wrote: On Tuesday, 4 January 2022 at 22:17:38 UTC, kdevel wrote: Is there any chance to rephrase fsobjects.d such that it becomes a "header only"/"compile only" file of which no object file must be presented to the linker? You didn't show ho

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 to

Re: Safe code doesnt seem to complain when it should

2022-01-06 Thread Paul Backus via Digitalmars-d-learn
On Thursday, 6 January 2022 at 16:12:10 UTC, HuskyNator wrote: I can't figure out why this code works: ```d union A { int* b; float c; } int fun(A a) @safe { return *(()=>a.b)(); // return *a.b; //Complains about pointer type overlap } ``` I tried to find out how

Safe code doesnt seem to complain when it should

2022-01-06 Thread HuskyNator via Digitalmars-d-learn
I can't figure out why this code works: ```d union A { int* b; float c; } int fun(A a) @safe { return *(()=>a.b)(); // return *a.b; //Complains about pointer type overlap } ``` I tried to find out how `@safe` should be handled in this scenario, and found [lambda'

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! I'v

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 l

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 l

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: std.concurrency and const

2022-01-06 Thread Christian Köstlin via Digitalmars-d-learn
On 2022-01-06 02:55, frame wrote: On Wednesday, 5 January 2022 at 22:22:19 UTC, Christian Köstlin wrote: Hi all, I really like std.concurrency but I now stumbled upon the following. When receiving messages as const, they also need to be sent as const (otherwise they are not matched). Comparing