Re: How to replace the main thread with custom thread

2019-05-04 Thread Heromyth via Digitalmars-d-learn
On Sunday, 5 May 2019 at 05:49:07 UTC, Heromyth wrote: We have made some extensions to std.thread. See: https://github.com/huntlabs/hunt/blob/master/source/hunt/concurrency/thread/ThreadEx.d. All the threads except the main thread now can be created with ThreadEx. My question is how can I

How to replace the main thread with custom thread

2019-05-04 Thread Heromyth via Digitalmars-d-learn
We have made some extensions to std.thread. See: https://github.com/huntlabs/hunt/blob/master/source/hunt/concurrency/thread/ThreadEx.d. All the threads except the main thread now can be created with ThreadEx. My question is how can I create the main thread with ThreadEx. Is it possible or

Re: Can't use threads

2019-05-04 Thread Andre Pany via Digitalmars-d-learn
On Saturday, 4 May 2019 at 22:29:26 UTC, Aldo wrote: Hello, i'm trying to run 3 threads with the following code : https://run.dlang.io/is/p4ThlD It works on run.dlang.io but not on my windows 10 : core.thread.ThreadError@src\core\thread.d(3078): Unable to load thread context If I lower

Can't use threads

2019-05-04 Thread Aldo via Digitalmars-d-learn
Hello, i'm trying to run 3 threads with the following code : https://run.dlang.io/is/p4ThlD It works on run.dlang.io but not on my windows 10 : core.thread.ThreadError@src\core\thread.d(3078): Unable to load thread context If I lower the allocated ubyte array it works...can you help me ?

Re: dub preBuildCommand removed?

2019-05-04 Thread James Blachly via Digitalmars-d-learn
On 5/4/19 5:27 PM, Andre Pany wrote: On Saturday, 4 May 2019 at 21:16:25 UTC, James Blachly wrote: It is listed in the build settings table of the referenced link. Kind regards Andre Somehow firefox enabled "whole word" search *rolleyes*, which I did not even realize was a thing. Thanks

Re: dub preBuildCommand removed?

2019-05-04 Thread Andre Pany via Digitalmars-d-learn
On Saturday, 4 May 2019 at 21:16:25 UTC, James Blachly wrote: the preBuildCommand is no longer listed in the dub format spec[1] although it shows up in the google cache for the page. When was it removed, and why? I can't find any announcement. [1] https://dub.pm/package-format-json.html It

dub preBuildCommand removed?

2019-05-04 Thread James Blachly via Digitalmars-d-learn
the preBuildCommand is no longer listed in the dub format spec[1] although it shows up in the google cache for the page. When was it removed, and why? I can't find any announcement. [1] https://dub.pm/package-format-json.html

Re: Cast ptr/len to D-style array

2019-05-04 Thread James Blachly via Digitalmars-d-learn
On 5/3/19 5:42 AM, Ali Çehreli wrote: On 05/02/2019 08:21 PM, James Blachly wrote: On 5/2/19 4:05 PM, ag0aep6g wrote: Just slice the pointer with the length: int* ptr; size_t len; int[] arr = ptr[0 .. len]; Perfect thanks. I searched but without using the magic word "slice" I

Re: I had a bad time with slice-in-struct array operation forwarding/mimicing. What's the best way to do it?

2019-05-04 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 4 May 2019 at 15:18:58 UTC, Random D user wrote: But array copy and setting/clearing doesn't: int[] bar = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 ]; foo[] = bar[]; And I get this very cryptic message: (6): Error: template `example.Array2D!int.Array2D.opSlice`

Re: I had a bad time with slice-in-struct array operation forwarding/mimicing. What's the best way to do it?

2019-05-04 Thread Nicholas Wilson via Digitalmars-d-learn
On Saturday, 4 May 2019 at 15:18:58 UTC, Random D user wrote: I wanted to make a 2D array like structure and support D slice like operations, but I had surprisingly bad experience. I quickly copy pasted the example from the docs: https://dlang.org/spec/operatoroverloading.html#array-ops

I had a bad time with slice-in-struct array operation forwarding/mimicing. What's the best way to do it?

2019-05-04 Thread Random D user via Digitalmars-d-learn
I wanted to make a 2D array like structure and support D slice like operations, but I had surprisingly bad experience. I quickly copy pasted the example from the docs: https://dlang.org/spec/operatoroverloading.html#array-ops It's something like this: struct Array2D(E) { E[] impl;

Re: Mixin can't access library symbols?

2019-05-04 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 4 May 2019 at 08:12:46 UTC, Alex wrote: mixin(defState!("XEvent value;")); mixin templates are used in the call scope, not the defining scope. That's true, but the code there is NOT a mixin template. mixin templates are always used mixin TemplateName; or mixin

Re: Mixin can't access library symbols?

2019-05-04 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 3 May 2019 at 17:55:19 UTC, faissaloo wrote: But it tells me it can't find the symbol XEvent despite me having used it elsewhere. Where is elsewhere? Is it in the same module as the mixin? mixin strings like that are similar to pasting the generated code into the site of the

Re: local dub dependencies - relative paths, copyFiles, etc

2019-05-04 Thread DanielG via Digitalmars-d-learn
Update: using the $PACKAGE_DIR environment variable for relative paths solved both issues.

Re: Mixin can't access library symbols?

2019-05-04 Thread Alex via Digitalmars-d-learn
On Friday, 3 May 2019 at 17:55:19 UTC, faissaloo wrote: On Friday, 3 May 2019 at 17:51:39 UTC, Adam D. Ruppe wrote: On Friday, 3 May 2019 at 17:48:50 UTC, faissaloo wrote: How can I get a mixin to implicitly include the symbols from its surrounding context? Is this possible? What's your big