Re: What are some ways to get more strict type-checking?

2019-05-05 Thread sarn via Digitalmars-d-learn
On Monday, 6 May 2019 at 02:02:52 UTC, Devin wrote: Recently, I poorly refactored some code, which introduced an obvious bug. But to my astonishment, the broken code compiled without any warnings or notifications. A minimum example is shown below: alias ID = uint; ... alias doesn't

What are some ways to get more strict type-checking?

2019-05-05 Thread Devin via Digitalmars-d-learn
Recently, I poorly refactored some code, which introduced an obvious bug. But to my astonishment, the broken code compiled without any warnings or notifications. A minimum example is shown below: alias ID = uint; struct Data { ID id; this(ID id) {

Re: alias to fully qualified symbol gives error, but when module is also a symbol

2019-05-05 Thread Dennis via Digitalmars-d-learn
On Sunday, 5 May 2019 at 18:07:10 UTC, Adam D. Ruppe wrote: The std.stdio one is supposed to be an error; the old buggy behavior was to bypass the private import in these cases and that is why it is deprecated pending changes. Thanks, that answers my question. The old private-bypassing

Run code before dub dependency's `shared static this()`

2019-05-05 Thread Vladimirs Nordholm via Digitalmars-d-learn
Hello. I have dub dependency which has a `shared static this()`. In my project, can I run code code before the dependency's `shared static this()`?

Re: Run code before dub dependency's `shared static this()`

2019-05-05 Thread Eugene Wissner via Digitalmars-d-learn
On Sunday, 5 May 2019 at 08:24:29 UTC, Vladimirs Nordholm wrote: Hello. I have dub dependency which has a `shared static this()`. In my project, can I run code code before the dependency's `shared static this()`? "Static constructors within a module are executed in the lexical order in

Re: Run code before dub dependency's `shared static this()`

2019-05-05 Thread Daniel N via Digitalmars-d-learn
On Sunday, 5 May 2019 at 08:24:29 UTC, Vladimirs Nordholm wrote: Hello. I have dub dependency which has a `shared static this()`. In my project, can I run code code before the dependency's `shared static this()`? This might work: pragma(crt_constructor) extern(C) void early_init() { }

Re: Can't use threads

2019-05-05 Thread zabruk via Digitalmars-d-learn
DMD32 D Compiler v2.084.0 code comiled by command dmd -i "test.d" On Sunday, 5 May 2019 at 09:31:13 UTC, zabruk wrote: It works for me (Microsoft Windows [Version 10.0.17134.706] 64-bit) start! start! start! end! end! end! start! start! end! start! end! end!

Re: Can't use threads

2019-05-05 Thread zabruk via Digitalmars-d-learn
It works for me (Microsoft Windows [Version 10.0.17134.706] 64-bit) start! start! start! end! end! end! start! start! end! start! end! end!

Re: Can't use threads

2019-05-05 Thread Aldo via Digitalmars-d-learn
On Sunday, 5 May 2019 at 03:32:37 UTC, Andre Pany wrote: On Saturday, 4 May 2019 at 22:29:26 UTC, Aldo wrote: Does it work on windows if you compile it it as 64 bit application (-m64 argument if I remember correctly, dub argument -a x86_64)? On linux and Darwin 64 is default while on windows

Compiler/Phobos/Types problem — panic level due to timing.

2019-05-05 Thread Russel Winder via Digitalmars-d-learn
Hi, I had merrily asumed I could implement nth Fibonacci number with: takeOne(drop(recurrence!((a, n) => a[n-1] + a[n-2])(zero, one), n)).front where zero and one are of type BigInt, and n is of type size_t. However both dmd and ldc2 complain saying:

Re: Any full feature xml library available?

2019-05-05 Thread Russel Winder via Digitalmars-d-learn
On Fri, 2019-05-03 at 14:07 -0700, H. S. Teoh via Digitalmars-d-learn wrote: > […] > The problem is that while there is no shortage of complaints about XML > support in D, there is a great dearth of people actually willing to *do* > something about it. In my case it is because I have no need to

Re: Compiler/Phobos/Types problem — panic level due to timing.

2019-05-05 Thread lithium iodate via Digitalmars-d-learn
On Sunday, 5 May 2019 at 18:53:08 UTC, Russel Winder wrote: Hi, I had merrily asumed I could implement nth Fibonacci number with: takeOne(drop(recurrence!((a, n) => a[n-1] + a[n-2])(zero, one), n)).front where zero and one are of type BigInt, and n is of type size_t. However both dmd

Re: Compiler/Phobos/Types problem — panic level due to timing.

2019-05-05 Thread Nicholas Wilson via Digitalmars-d-learn
On Sunday, 5 May 2019 at 19:18:47 UTC, lithium iodate wrote: On Sunday, 5 May 2019 at 18:53:08 UTC, Russel Winder wrote: Hi, I had merrily asumed I could implement nth Fibonacci number with: takeOne(drop(recurrence!((a, n) => a[n-1] + a[n-2])(zero, one), n)).front where zero and one

Re: Can't use threads

2019-05-05 Thread Andre Pany via Digitalmars-d-learn
On Sunday, 5 May 2019 at 12:28:34 UTC, Aldo wrote: On Sunday, 5 May 2019 at 03:32:37 UTC, Andre Pany wrote: On Saturday, 4 May 2019 at 22:29:26 UTC, Aldo wrote: Does it work on windows if you compile it it as 64 bit application (-m64 argument if I remember correctly, dub argument -a x86_64)?

Re: alias to fully qualified symbol gives error, but when module is also a symbol

2019-05-05 Thread Adam D. Ruppe via Digitalmars-d-learn
On Sunday, 5 May 2019 at 15:22:31 UTC, Dennis wrote: I was trying to rename an imported `sqrt` (wrongly), but I stumbled upon this weird behavior: ``` void main() { import core.stdc.math: sqrtf, sqrt; alias sqrtd = core.stdc.math.sqrt; auto a = sqrtd(1); } ``` onlineapp.d(3): Error:

alias to fully qualified symbol gives error, but when module is also a symbol

2019-05-05 Thread Dennis via Digitalmars-d-learn
I was trying to rename an imported `sqrt` (wrongly), but I stumbled upon this weird behavior: ``` void main() { import core.stdc.math: sqrtf, sqrt; alias sqrtd = core.stdc.math.sqrt; auto a = sqrtd(1); } ``` onlineapp.d(3): Error: undefined identifier core.stdc.math.sqrt However,