Re: byKeyValue is not available at compilation-time right ?

2021-07-25 Thread Adam D Ruppe via Digitalmars-d-learn
On Sunday, 25 July 2021 at 18:03:05 UTC, someone wrote: pstrExchangeID = structureExchanges[r"NYSE"d].ID; well that's a compile time constant structureExchanges[lstrExchangeID].location; And that's a compile time constant. So you could just pass the data directly as a variable. So ins

Re: byKeyValue is not available at compilation-time right ?

2021-07-25 Thread someone via Digitalmars-d-learn
On Sunday, 25 July 2021 at 17:45:18 UTC, Adam D Ruppe wrote: On Sunday, 25 July 2021 at 17:29:46 UTC, someone wrote: What is the proper syntax to use manifest-constants with associative arrays then ? The one you showed me ? You have the right syntax for that. What I'm saying is you might not

Re: byKeyValue is not available at compilation-time right ?

2021-07-25 Thread Adam D Ruppe via Digitalmars-d-learn
On Sunday, 25 July 2021 at 17:29:46 UTC, someone wrote: What is the proper syntax to use manifest-constants with associative arrays then ? The one you showed me ? You have the right syntax for that. What I'm saying is you might not need the associative array at all. Why do you want to use tha

Re: byKeyValue is not available at compilation-time right ?

2021-07-25 Thread someone via Digitalmars-d-learn
On Sunday, 25 July 2021 at 07:22:54 UTC, jfondren wrote: On Sunday, 25 July 2021 at 05:10:32 UTC, someone wrote: /// implementation: however, would it be possible to dynamically‐load the following enums from a file at compilation‐time ? public immutable enum structureLocations = [ r"BUE"d

Re: byKeyValue is not available at compilation-time right ?

2021-07-25 Thread someone via Digitalmars-d-learn
On Sunday, 25 July 2021 at 10:30:47 UTC, Adam D Ruppe wrote: On Sunday, 25 July 2021 at 05:10:32 UTC, someone wrote: As you can see in the following code I cannot avoid to type the public immutable enum structureLocations = [ r"BUE"d : typeLocation(r"arg"d, r"Buenos Aires"d, r"ART"d), r"G

Re: POST request with std.net.curl

2021-07-25 Thread frame via Digitalmars-d-learn
On Sunday, 25 July 2021 at 13:07:36 UTC, bachmeier wrote: On Friday, 23 July 2021 at 18:11:51 UTC, bachmeier wrote: [...] After all this, it turned out the answer was a simple (but not obvious) typo in the header information. It would be nice to get more information than "HTTP request returne

Re: POST request with std.net.curl

2021-07-25 Thread bachmeier via Digitalmars-d-learn
On Friday, 23 July 2021 at 18:11:51 UTC, bachmeier wrote: [...] After all this, it turned out the answer was a simple (but not obvious) typo in the header information. It would be nice to get more information than "HTTP request returned status code 400 ()". I don't know if that's possible, bu

Re: POST request with std.net.curl

2021-07-25 Thread bachmeier via Digitalmars-d-learn
On Saturday, 24 July 2021 at 06:01:25 UTC, frame wrote: On Friday, 23 July 2021 at 21:25:01 UTC, bachmeier wrote: Authorization is working - it's the same whether I'm doing a GET or POST request. The problem is passing the data. The main problem is that the documentation doesn't explain how to

Re: Traceinfo gone

2021-07-25 Thread frame via Digitalmars-d-learn
On Sunday, 25 July 2021 at 10:26:34 UTC, Adam D Ruppe wrote: On Saturday, 24 July 2021 at 08:41:20 UTC, frame wrote: I recently discovered that my exceptions do not show a trace anymore. How can this happen? It needs to load the .pdb file at runtime, so make sure it stays next to your exe.

Re: How to check if variable of some type can be of null value?

2021-07-25 Thread Adam D Ruppe via Digitalmars-d-learn
On Saturday, 24 July 2021 at 18:10:07 UTC, Alexey wrote: The goal I with to achieve by this check - is to use template and to assign value to variable basing on it's ability to accept null as a value. The most direct representation of that is __traits(compiles, (T t) { t = null; }); Anothe

Re: byKeyValue is not available at compilation-time right ?

2021-07-25 Thread Adam D Ruppe via Digitalmars-d-learn
On Sunday, 25 July 2021 at 05:10:32 UTC, someone wrote: As you can see in the following code I cannot avoid to type the public immutable enum structureLocations = [ r"BUE"d : typeLocation(r"arg"d, r"Buenos Aires"d, r"ART"d), r"GRU"d : typeLocation(r"bra"d, r"São Paulo"d, r"BRT"d), Coudln

Re: Traceinfo gone

2021-07-25 Thread Adam D Ruppe via Digitalmars-d-learn
On Saturday, 24 July 2021 at 08:41:20 UTC, frame wrote: I recently discovered that my exceptions do not show a trace anymore. How can this happen? It needs to load the .pdb file at runtime, so make sure it stays next to your exe.

Re: Destructors can't be @nogc?

2021-07-25 Thread Tejas via Digitalmars-d-learn
On Friday, 23 July 2021 at 20:24:02 UTC, Jim wrote: Hello, I've been playing with D and trying to understand how to work with @nogc. I must be doing something wrong, because even though I tagged the destructor for my class `@nogc`, I'm getting the following error: `.\min.d(27): Error: "@nogc"

Re: byKeyValue is not available at compilation-time right ?

2021-07-25 Thread jfondren via Digitalmars-d-learn
On Sunday, 25 July 2021 at 05:10:32 UTC, someone wrote: /// implementation: however, would it be possible to dynamically‐load the following enums from a file at compilation‐time ? public immutable enum structureLocations = [ r"BUE"d : typeLocation(r"arg"d, r"Buenos Aires"d, r"ART"d), r"G

Re: Traceinfo gone

2021-07-25 Thread frame via Digitalmars-d-learn
On Saturday, 24 July 2021 at 08:41:20 UTC, frame wrote: I cannot reproduce it with a standalone example app Meanwhile I can, it seems a linking problem or I'm doing something wrong? Please consider: ```d // dmd -m64 -L/DLL -version=lib test.d -of=common.dll // dmd -m64 test.d // test.d ve