Re: Dub platform probes

2020-05-26 Thread Tim via Digitalmars-d-learn
On Tuesday, 26 May 2020 at 09:17:52 UTC, Andre Pany wrote: Hi, What version of dub do you use? I am not 100 % sure but thought platform probes do not longer write files with recent dub version. Do you use DMD or LDC or GDC? Kind regards Andre Hi there I'm using Dub 1.19.0-1build2 with dmd

Re: Mir Slice Column or Row Major

2020-05-26 Thread data pulverizer via Digitalmars-d-learn
On Wednesday, 27 May 2020 at 01:31:23 UTC, data pulverizer wrote: Hi, I have started running Kernel benchmarks calculations using Mir NDSlice, and I'm getting times that are much slower than expected. I've swapped the calculation to row major and it's running as expected.

Re: How to target ldc compiler only in dub

2020-05-26 Thread data pulverizer via Digitalmars-d-learn
On Wednesday, 27 May 2020 at 02:09:48 UTC, Mike Parker wrote: Thanks. Is there anyway to verify that the flags I am passing to the compiler are being used? dub -v It shows you the full compiler command line. Ah, I forgot to force the rebuild. Thanks.

Re: How to target ldc compiler only in dub

2020-05-26 Thread Mathias LANG via Digitalmars-d-learn
On Tuesday, 26 May 2020 at 22:28:14 UTC, data pulverizer wrote: Hi, I am trying to build a package to target LDC compiler only. I have both dmd and ldc2 (1.18.0) installed on my system. The dub file is: ``` { "authors": [ "Me" ], "copyright":

Re: How to target ldc compiler only in dub

2020-05-26 Thread Mike Parker via Digitalmars-d-learn
On Wednesday, 27 May 2020 at 01:41:47 UTC, data pulverizer wrote: On Wednesday, 27 May 2020 at 01:06:48 UTC, mw wrote: And you can use option dub -v to verify it's calling the correct compiler cmd. Thanks. Is there anyway to verify that the flags I am passing to the compiler are being

Re: Distinguish between a null array and an empty array

2020-05-26 Thread Dukc via Digitalmars-d-learn
On Sunday, 24 May 2020 at 12:29:23 UTC, bauss wrote: Dang, that sucks there is no proper way and I would say that's a big flaw of D. Because what I need it for is for some data serialization but if the value is an empty array then it should be present and if it's null then it should not be

Re: How to target ldc compiler only in dub

2020-05-26 Thread data pulverizer via Digitalmars-d-learn
On Wednesday, 27 May 2020 at 01:06:48 UTC, mw wrote: And you can use option dub -v to verify it's calling the correct compiler cmd. Thanks. Is there anyway to verify that the flags I am passing to the compiler are being used?

Re: m32mscoff with lld-link causes SEH errors

2020-05-26 Thread Daniel C via Digitalmars-d-learn
On Tuesday, 26 May 2020 at 15:56:31 UTC, kinke wrote: Using `-L/safeseh:no` should work around this. It successfully made the executable, and it runs fine - until exit lol. Must be more tweaks needed. Edit source/app.d to start your project. object.Error@(0): Access Violation

Mir Slice Column or Row Major

2020-05-26 Thread data pulverizer via Digitalmars-d-learn
Hi, I have started running Kernel benchmarks calculations using Mir NDSlice, and I'm getting times that are much slower than expected. To check that I'm not making an obvious mistake, below are samples of the code I am using. The way the selection happens is that the `calculateKernelMatrix`

Re: How to target ldc compiler only in dub

2020-05-26 Thread mw via Digitalmars-d-learn
On Wednesday, 27 May 2020 at 00:54:45 UTC, data pulverizer wrote: On Wednesday, 27 May 2020 at 00:52:55 UTC, mw wrote: On Tuesday, 26 May 2020 at 22:28:14 UTC, data pulverizer wrote: I am trying to build a package to target LDC compiler only. I set env: LDC= DUB = $(LDC)/bin/dub then, run

Re: How to target ldc compiler only in dub

2020-05-26 Thread mw via Digitalmars-d-learn
On Tuesday, 26 May 2020 at 22:28:14 UTC, data pulverizer wrote: I am trying to build a package to target LDC compiler only. I set env: LDC= DUB = $(LDC)/bin/dub then, run this new dub: $(DUB) build

Re: How to target ldc compiler only in dub

2020-05-26 Thread data pulverizer via Digitalmars-d-learn
On Wednesday, 27 May 2020 at 00:52:55 UTC, mw wrote: On Tuesday, 26 May 2020 at 22:28:14 UTC, data pulverizer wrote: I am trying to build a package to target LDC compiler only. I set env: LDC= DUB = $(LDC)/bin/dub then, run this new dub: $(DUB) build Thanks. Building with `dub run

How to target ldc compiler only in dub

2020-05-26 Thread data pulverizer via Digitalmars-d-learn
Hi, I am trying to build a package to target LDC compiler only. I have both dmd and ldc2 (1.18.0) installed on my system. The dub file is: ``` { "authors": [ "Me" ], "copyright": "Copyright © 2020, Me", "dependencies": {

Re: How to get the pointer of "this" ?

2020-05-26 Thread bauss via Digitalmars-d-learn
On Tuesday, 26 May 2020 at 12:08:29 UTC, Johannes Loher wrote: On Tuesday, 26 May 2020 at 11:44:58 UTC, Vinod K Chandran wrote: On Monday, 25 May 2020 at 16:39:30 UTC, Mike Parker wrote: On Monday, 25 May 2020 at 08:39:23 UTC, John Burton wrote: I believe that in D *this* is a reference to

Re: m32mscoff with lld-link causes SEH errors

2020-05-26 Thread Daniel C via Digitalmars-d-learn
On Tuesday, 26 May 2020 at 15:56:31 UTC, kinke wrote: On Monday, 25 May 2020 at 01:32:58 UTC, Daniel C wrote: Is lld-link only for 64-bit compiles (-m64 is the only one that gives no errors) Nope, but SafeSEH is a 32-bit-only feature. DMD doesn't emit SafeSEH compatible object files, and LLD

Re: How to get the pointer of "this" ?

2020-05-26 Thread Vinod K Chandran via Digitalmars-d-learn
On Tuesday, 26 May 2020 at 14:42:04 UTC, Steven Schveighoffer wrote: On Tuesday, 26 May 2020 at 14:42:04 UTC, Steven Schveighoffer wrote: Hm... According to run.dlang.io, this behavior changed in 2.072 (prior to that it worked). In 2.067.1 to 2.071.2, changing the this reference was

Re: How to get the pointer of "this" ?

2020-05-26 Thread John Chapman via Digitalmars-d-learn
On Tuesday, 26 May 2020 at 13:37:22 UTC, Vinod K Chandran wrote: On Tuesday, 26 May 2020 at 12:41:20 UTC, John Chapman wrote: On Monday, 25 May 2020 at 16:26:31 UTC, Vinod K Chandran wrote: Here is my full code. Please take a look. https://pastebin.com/av3nrvtT Change line 124 to:

Re: Distinguish between a null array and an empty array

2020-05-26 Thread Steven Schveighoffer via Digitalmars-d-learn
On 5/24/20 8:12 AM, bauss wrote: Is there a way to do that? Since the following are both true: int[] a = null; int[] b = []; assert(a is null); assert(!a.length); assert(b is null); assert(!b.length); What I would like is to tell that b is an empty array and a is a null array. The issue

Re: m32mscoff with lld-link causes SEH errors

2020-05-26 Thread kinke via Digitalmars-d-learn
On Monday, 25 May 2020 at 01:32:58 UTC, Daniel C wrote: Is lld-link only for 64-bit compiles (-m64 is the only one that gives no errors) Nope, but SafeSEH is a 32-bit-only feature. DMD doesn't emit SafeSEH compatible object files, and LLD seems to have a different default setting in that

Re: [GTK-D] dub run leads to lld-link: error: could not open libcmt.lib: no such file or directory

2020-05-26 Thread jmh530 via Digitalmars-d-learn
On Tuesday, 26 May 2020 at 15:18:42 UTC, jmh530 wrote: On Tuesday, 26 May 2020 at 15:16:25 UTC, jmh530 wrote: [snip] Another short-term fix might be to try compiling with the -m32 dflag (need to put in your dub.sdl/json). Sorry, easier is dub test --arch=x86 You may also have to make

Re: [GTK-D] dub run leads to lld-link: error: could not open libcmt.lib: no such file or directory

2020-05-26 Thread jmh530 via Digitalmars-d-learn
On Wednesday, 13 May 2020 at 15:26:48 UTC, BoQsc wrote: [snip] Linking... lld-link: error: could not open libcmt.lib: no such file or directory lld-link: error: could not open OLDNAMES.lib: no such file or directory Error: linker exited with status 1 C:\D\dmd2\windows\bin\dmd.exe failed with

Re: [GTK-D] dub run leads to lld-link: error: could not open libcmt.lib: no such file or directory

2020-05-26 Thread jmh530 via Digitalmars-d-learn
On Tuesday, 26 May 2020 at 15:16:25 UTC, jmh530 wrote: [snip] Another short-term fix might be to try compiling with the -m32 dflag (need to put in your dub.sdl/json). Sorry, easier is dub test --arch=x86

Re: How to get the pointer of "this" ?

2020-05-26 Thread Steven Schveighoffer via Digitalmars-d-learn
On 5/26/20 8:08 AM, Johannes Loher wrote: On Tuesday, 26 May 2020 at 11:44:58 UTC, Vinod K Chandran wrote: On Monday, 25 May 2020 at 16:39:30 UTC, Mike Parker wrote: On Monday, 25 May 2020 at 08:39:23 UTC, John Burton wrote: I believe that in D *this* is a reference to the object and not a

Re: Learning Vibe.d

2020-05-26 Thread Steven Schveighoffer via Digitalmars-d-learn
On 5/25/20 5:49 AM, Daniel Kozak wrote: On Sun, May 24, 2020 at 10:06 AM Russel Winder via Digitalmars-d-learn wrote: For my purposes switching to using SIGKILL rather than SIGTERM in my tests seems to work with 1.9.1, so I'll go with that till 1.9.2 or 1.10.0 produces a fix rather than

Flagging spam on forum.dlang.org

2020-05-26 Thread Steven Schveighoffer via Digitalmars-d-learn
Someone asked this question in response to SPAM, and I don't want to answer it there, because I'm expecting that entire subthread to be removed. Yes, there is a flag button on forum.dlang.org. I'm not sure if you need permissions to access it, but it allows you to flag the maintainers to look

Re: How to get the pointer of "this" ?

2020-05-26 Thread Johannes Loher via Digitalmars-d-learn
Am 26.05.20 um 16:17 schrieb Vinod K Chandran: > On Tuesday, 26 May 2020 at 13:48:52 UTC, ag0aep6g wrote: >> On 26.05.20 15:43, Vinod K Chandran wrote: >>> So far now, two solutions are very clear for this problem. >>> 1. As per John Chapman's suggestion - use >>> cast(DWORD_PTR)cast(void*)this).

Re: How to get the pointer of "this" ?

2020-05-26 Thread Vinod K Chandran via Digitalmars-d-learn
On Tuesday, 26 May 2020 at 13:48:52 UTC, ag0aep6g wrote: On 26.05.20 15:43, Vinod K Chandran wrote: So far now, two solutions are very clear for this problem. 1. As per John Chapman's suggestion - use cast(DWORD_PTR)cast(void*)this). 2. Use another varibale to use as an lvalue. - Button

Re: Assign Range: layout = X, AlignRight;

2020-05-26 Thread Paul Backus via Digitalmars-d-learn
On Tuesday, 26 May 2020 at 13:36:34 UTC, Виталий Фадеев wrote: I want this: layout = X, AlignRight; Use case: class Widget { struct Layout { ILayout[] _layouts; void opAssign( args... ) { foreach( a; args ) {

Re: How to get the pointer of "this" ?

2020-05-26 Thread Vinod K Chandran via Digitalmars-d-learn
On Tuesday, 26 May 2020 at 13:44:24 UTC, Adam D. Ruppe wrote: On Tuesday, 26 May 2020 at 11:35:23 UTC, Vinod K Chandran wrote: Okay, but uint is working perfectly. It won't if you use -m64. Okay. I got it.

Re: Assign Range: layout = X, AlignRight;

2020-05-26 Thread Виталий Фадеев via Digitalmars-d-learn
On Tuesday, 26 May 2020 at 13:36:34 UTC, Виталий Фадеев wrote: I want this: layout = X, AlignRight; Use case: class Widget { struct Layout { ILayout[] _layouts; void opAssign( args... ) { foreach( a; args ) {

Re: Assign Range: layout = X, AlignRight;

2020-05-26 Thread WebFreak001 via Digitalmars-d-learn
On Tuesday, 26 May 2020 at 13:36:34 UTC, Виталий Фадеев wrote: [...] I want this feature in D! I think you are rather looking for tuples: void opAssign(Args...)(Tuple!Args args) { foreach( a; args ) { _layouts ~= a; }

Re: Distinguish between a null array and an empty array

2020-05-26 Thread WebFreak001 via Digitalmars-d-learn
On Sunday, 24 May 2020 at 12:37:20 UTC, ag0aep6g wrote: On 24.05.20 14:29, bauss wrote: Dang, that sucks there is no proper way and I would say that's a big flaw of D. Because what I need it for is for some data serialization but if the value is an empty array then it should be present and

Re: How to get the pointer of "this" ?

2020-05-26 Thread ag0aep6g via Digitalmars-d-learn
On 26.05.20 15:43, Vinod K Chandran wrote: So far now, two solutions are very clear for this problem. 1. As per John Chapman's suggestion - use cast(DWORD_PTR)cast(void*)this). 2. Use another varibale to use as an lvalue. - Button dummyBtn = this; cast(DWORD_PTR) Among these two, i

Re: How to get the pointer of "this" ?

2020-05-26 Thread Adam D. Ruppe via Digitalmars-d-learn
On Tuesday, 26 May 2020 at 11:35:23 UTC, Vinod K Chandran wrote: Okay, but uint is working perfectly. It won't if you use -m64.

Re: How to get the pointer of "this" ?

2020-05-26 Thread Vinod K Chandran via Digitalmars-d-learn
On Tuesday, 26 May 2020 at 13:37:22 UTC, Vinod K Chandran wrote: On Tuesday, 26 May 2020 at 12:41:20 UTC, John Chapman wrote: On Monday, 25 May 2020 at 16:26:31 UTC, Vinod K Chandran wrote: Here is my full code. Please take a look. https://pastebin.com/av3nrvtT Change line 124 to:

Assign Range: layout = X, AlignRight;

2020-05-26 Thread Виталий Фадеев via Digitalmars-d-learn
I want this: layout = X, AlignRight; Use case: class Widget { struct Layout { ILayout[] _layouts; void opAssign( args... ) { foreach( a; args ) { _layouts ~= a; } } alias _layouts this;

Re: How to get the pointer of "this" ?

2020-05-26 Thread Vinod K Chandran via Digitalmars-d-learn
On Tuesday, 26 May 2020 at 12:08:29 UTC, Johannes Loher wrote: On Tuesday, 26 May 2020 at 11:44:58 UTC, Vinod K Chandran wrote: [...] [...] It doesn't compile, the line string mt [...] Hi, Sorry for the typos in my code.

Re: How to get the pointer of "this" ?

2020-05-26 Thread Vinod K Chandran via Digitalmars-d-learn
On Tuesday, 26 May 2020 at 12:41:20 UTC, John Chapman wrote: On Monday, 25 May 2020 at 16:26:31 UTC, Vinod K Chandran wrote: Here is my full code. Please take a look. https://pastebin.com/av3nrvtT Change line 124 to: SetWindowSubclass(this.mHandle, SUBCLASSPROC(), UINT_PTR(subClsID),

Re: How to get the pointer of "this" ?

2020-05-26 Thread John Chapman via Digitalmars-d-learn
On Monday, 25 May 2020 at 16:26:31 UTC, Vinod K Chandran wrote: Here is my full code. Please take a look. https://pastebin.com/av3nrvtT Change line 124 to: SetWindowSubclass(this.mHandle, SUBCLASSPROC(), UINT_PTR(subClsID), cast(DWORD_PTR)cast(void*)this); That is, change `` to

Re: How to get the pointer of "this" ?

2020-05-26 Thread Johannes Loher via Digitalmars-d-learn
On Tuesday, 26 May 2020 at 12:08:29 UTC, Johannes Loher wrote: [...] Small correction: I said that this is an lvalue and that you cannot take the address of lvalues. Of course that is incorrect, I meant to say that rvalues (this is an rvalue and you cannot take the address of rvalues).

Re: How to get the pointer of "this" ?

2020-05-26 Thread Johannes Loher via Digitalmars-d-learn
On Tuesday, 26 May 2020 at 11:44:58 UTC, Vinod K Chandran wrote: On Monday, 25 May 2020 at 16:39:30 UTC, Mike Parker wrote: On Monday, 25 May 2020 at 08:39:23 UTC, John Burton wrote: I believe that in D *this* is a reference to the object and not a pointer like in C++. So I think that writing

Re: How to get the pointer of "this" ?

2020-05-26 Thread Vinod K Chandran via Digitalmars-d-learn
On Monday, 25 May 2020 at 16:39:30 UTC, Mike Parker wrote: On Monday, 25 May 2020 at 08:39:23 UTC, John Burton wrote: I believe that in D *this* is a reference to the object and not a pointer like in C++. So I think that writing might be what you need? No. A class reference is a pointer

Re: How to get the pointer of "this" ?

2020-05-26 Thread Vinod K Chandran via Digitalmars-d-learn
On Monday, 25 May 2020 at 18:42:33 UTC, bauss wrote: On Monday, 25 May 2020 at 17:14:13 UTC, Vinod K Chandran wrote: On Monday, 25 May 2020 at 16:54:11 UTC, Mike Parker wrote: [...] Hi @Mike Parker, Thank you for your valuable suggestions. I will sure follow them. Well, the exact line

Re: How to get the pointer of "this" ?

2020-05-26 Thread Vinod K Chandran via Digitalmars-d-learn
On Monday, 25 May 2020 at 22:54:32 UTC, Adam D. Ruppe wrote: On Monday, 25 May 2020 at 22:31:00 UTC, Vinod K Chandran wrote: A dword is an unsigned, 32-bit unit of data. We can use uint in D. I have tried that too, but no luck. A DWORD_PTR is *not* the same as a uint. It is more like a

Re: ModuleInfo and -fno-moduleinfo option

2020-05-26 Thread kinke via Digitalmars-d-learn
ModuleInfos are essential for the module ctors and dtors (of used modules) to be run, incl. a dependency tree defining their order of execution. They're also needed for running the unittests.

Re: Dub platform probes

2020-05-26 Thread Andre Pany via Digitalmars-d-learn
On Monday, 25 May 2020 at 22:58:54 UTC, Tim wrote: Hi all I end up with a directory flooded with platform probes. How can I make sure that old ones are deleted automatically? Thanks Hi, What version of dub do you use? I am not 100 % sure but thought platform probes do not longer write