Re: Complicated @property access only works when I write an extra parenthesis "()"

2023-05-26 Thread realhet via Digitalmars-d-learn
On Friday, 26 May 2023 at 21:11:45 UTC, Adam D Ruppe wrote: On Friday, 26 May 2023 at 21:00:20 UTC, realhet wrote: Only the extra () let it compile successfuly. No way to fix it. If the function takes an extra argument you can kinda trick it but for zero arg function pointer return from a

Re: Complicated @property access only works when I write an extra parenthesis "()"

2023-05-26 Thread realhet via Digitalmars-d-learn
On Friday, 26 May 2023 at 21:00:20 UTC, realhet wrote: Update: ``` auto x = karcSamples[a.key].lod0; print(x._size); auto y = karcSamples[a.key].lod0(); print(y._size); with(karcSamples[a.key].lod0) print(_size); with(karcSamples[a.key].lod0()) print(_size); ``` When I put it into a

Re: Complicated @property access only works when I write an extra parenthesis "()"

2023-05-26 Thread Adam D Ruppe via Digitalmars-d-learn
On Friday, 26 May 2023 at 21:00:20 UTC, realhet wrote: Only the extra () let it compile successfuly. No way to fix it. If the function takes an extra argument you can kinda trick it but for zero arg function pointer return from a property it is just plain broken and has been the whole time.

Complicated @property access only works when I write an extra parenthesis "()"

2023-05-26 Thread realhet via Digitalmars-d-learn
Hello, I tried to narrow the problem and make a small example, but I've failed. I try to describe the syndrome, maybe someone knows about it. (I heard that @properties are not 100% functional, maybe it's because of that, I dunno...) With pragma msg, I verify the time of things:

Re: How make a Dlang with Windows GUI x64 without console?

2023-05-26 Thread Marcone via Digitalmars-d-learn
On Friday, 26 May 2023 at 19:17:28 UTC, John Chapman wrote: On Friday, 26 May 2023 at 18:05:38 UTC, Marcone wrote: How can I hide console of a window GUI on Windows x64? I need run with -m64 -L/SUBSYSTEM:Windows And if you're using 'main' as the entry point rather than 'WinMain':

Re: How make a Dlang with Windows GUI x64 without console?

2023-05-26 Thread Marcone via Digitalmars-d-learn
On Friday, 26 May 2023 at 19:15:16 UTC, ryuukk_ wrote: On Friday, 26 May 2023 at 18:05:38 UTC, Marcone wrote: How can I hide console of a window GUI on Windows x64? I need run with -m64 Someone asked the exact same thing yesterday, check their post:

Re: How make a Dlang with Windows GUI x64 without console?

2023-05-26 Thread ryuukk_ via Digitalmars-d-learn
On Friday, 26 May 2023 at 18:05:38 UTC, Marcone wrote: How can I hide console of a window GUI on Windows x64? I need run with -m64 Someone asked the exact same thing yesterday, check their post: https://forum.dlang.org/thread/azlraopxmidtcdmnr...@forum.dlang.org ``` "lflags-windows": [

Re: string to char[4] FourCC conversion

2023-05-26 Thread realhet via Digitalmars-d-learn
On Friday, 26 May 2023 at 13:18:15 UTC, Steven Schveighoffer wrote: This worked for me: ```d char[4] fourC(string s) { if(s.length >= 4) return s[0 .. 4]; char[4] res = 0; res[0 .. s.length] = s; return res; } ``` Sometimes I forget that the return does an implicit

Re: string to char[4] FourCC conversion

2023-05-26 Thread Steven Schveighoffer via Digitalmars-d-learn
On 5/26/23 8:19 AM, realhet wrote: Hello, Is there a way to do it nicer/better/faster/simpler? ``` char[4] fourC(string s) { uint res;//Zero initialized, not 0xff initialized. auto cnt = min(s.length, 4),     p = cast(char[4]*)(); (*p)[0..cnt] = s[0..cnt]; return

How static link dll msvcr120.dll?

2023-05-26 Thread Marcone via Digitalmars-d-learn
How can I static link msvcr120.dll using dmd?

string to char[4] FourCC conversion

2023-05-26 Thread realhet via Digitalmars-d-learn
Hello, Is there a way to do it nicer/better/faster/simpler? ``` char[4] fourC(string s) { uint res;//Zero initialized, not 0xff initialized. autocnt = min(s.length, 4), p = cast(char[4]*)(); (*p)[0..cnt] = s[0..cnt]; return *p; } ``` I tried

Re: How to deal with interdependent dlang PRs?

2023-05-26 Thread Quirin Schroll via Digitalmars-d-learn
On Thursday, 25 May 2023 at 20:18:08 UTC, Dennis wrote: On Thursday, 25 May 2023 at 15:37:00 UTC, Quirin Schroll wrote: Is there a process? I can’t be the first one running into this. Doing it in 3 PRs is the process. Okay. It’s not that bad. This is one of the reasons why druntime was

Re: Multiple destructors

2023-05-26 Thread Basile B. via Digitalmars-d-learn
On Friday, 26 May 2023 at 09:07:07 UTC, Alex Biscotti wrote: Hello everyone! While researching the phobos library, I discovered that a class can have multiple destructors if the destructors are added via mixin injection. Accordingly, the question is whether a description of such feature should

Re: Multiple destructors

2023-05-26 Thread Alex Biscotti via Digitalmars-d-learn
On Friday, 26 May 2023 at 09:49:21 UTC, Ernesto Castellotti wrote: Currently the spec says "If the name of a declaration in a mixin is the same as a declaration in the surrounding scope, the surrounding declaration overrides the mixin one", I understand why this occurs with the current

Re: Multiple destructors

2023-05-26 Thread Ernesto Castellotti via Digitalmars-d-learn
On Friday, 26 May 2023 at 09:39:29 UTC, Alex Biscotti wrote: On Friday, 26 May 2023 at 09:24:29 UTC, Ernesto Castellotti wrote: On Friday, 26 May 2023 at 09:17:34 UTC, Alex Biscotti wrote: On Friday, 26 May 2023 at 09:11:47 UTC, Ernesto Castellotti wrote: On Friday, 26 May 2023 at 09:07:07

Re: Multiple destructors

2023-05-26 Thread Alex Biscotti via Digitalmars-d-learn
On Friday, 26 May 2023 at 09:24:29 UTC, Ernesto Castellotti wrote: On Friday, 26 May 2023 at 09:17:34 UTC, Alex Biscotti wrote: On Friday, 26 May 2023 at 09:11:47 UTC, Ernesto Castellotti wrote: On Friday, 26 May 2023 at 09:07:07 UTC, Alex Biscotti wrote: Hello everyone! While researching the

Re: Multiple destructors

2023-05-26 Thread Ernesto Castellotti via Digitalmars-d-learn
On Friday, 26 May 2023 at 09:17:34 UTC, Alex Biscotti wrote: On Friday, 26 May 2023 at 09:11:47 UTC, Ernesto Castellotti wrote: On Friday, 26 May 2023 at 09:07:07 UTC, Alex Biscotti wrote: Hello everyone! While researching the phobos library, I discovered that a class can have multiple

Re: Multiple destructors

2023-05-26 Thread Alex Biscotti via Digitalmars-d-learn
On Friday, 26 May 2023 at 09:11:47 UTC, Ernesto Castellotti wrote: On Friday, 26 May 2023 at 09:07:07 UTC, Alex Biscotti wrote: Hello everyone! While researching the phobos library, I discovered that a class can have multiple destructors if the destructors are added via mixin injection.

Re: Multiple destructors

2023-05-26 Thread Ernesto Castellotti via Digitalmars-d-learn
On Friday, 26 May 2023 at 09:07:07 UTC, Alex Biscotti wrote: Hello everyone! While researching the phobos library, I discovered that a class can have multiple destructors if the destructors are added via mixin injection. Accordingly, the question is whether a description of such feature should

Multiple destructors

2023-05-26 Thread Alex Biscotti via Digitalmars-d-learn
Hello everyone! While researching the phobos library, I discovered that a class can have multiple destructors if the destructors are added via mixin injection. Accordingly, the question is whether a description of such feature should be added to the documentation, since the current description