Problems with dmd Switches in Makefiles

2014-05-17 Thread Tom Browder via Digitalmars-d-learn
I know I'm supposed to use dub, but I'm not ready. I just found out I can't use dmd switches for file names variable in a GNU makefile, e.g., see this fragment %.o : %.d dmd -c $ -of $@ which doesn't work because the -of must be followed immediately by a file name with no intervening

Re: Problems with dmd Switches in Makefiles

2014-05-17 Thread via Digitalmars-d-learn
On Saturday, 17 May 2014 at 13:01:07 UTC, Tom Browder via Digitalmars-d-learn wrote: I know I'm supposed to use dub, but I'm not ready. I just found out I can't use dmd switches for file names variable in a GNU makefile, e.g., see this fragment %.o : %.d dmd -c $ -of $@ which doesn't

Re: Problems with dmd Switches in Makefiles

2014-05-17 Thread Tom Browder via Digitalmars-d-learn
On Sat, May 17, 2014 at 8:05 AM, via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Saturday, 17 May 2014 at 13:01:07 UTC, Tom Browder via Digitalmars-d-learn wrote: ... I just found out I can't use dmd switches for file names variable in a GNU makefile, e.g., see this

Re: Objects(from classes) at Compile time? no gc

2014-05-17 Thread via Digitalmars-d-learn
On Friday, 16 May 2014 at 22:48:08 UTC, Taylor Hillegeist wrote: Although, I don't know if it will allocate it during runtime as well. It will not. -Steve Does this work in GDC? Can't test in GDC, but it does work in LDC, and I see no reason why it shouldn't, because this functionality

std.concurrency thread communication problem

2014-05-17 Thread Charles Hixson via Digitalmars-d-learn
I'm building a program which I intend to have many threads that can each send messages to (and receive messages from) each other. The obvious way to do this would be to have a shared array of Tids, but this seems to not work. I'm continually fighting the system to get it to compile, and this

Re: std.concurrency thread communication problem

2014-05-17 Thread John Colvin via Digitalmars-d-learn
On Saturday, 17 May 2014 at 18:43:25 UTC, Charles Hixson via Digitalmars-d-learn wrote: I'm building a program which I intend to have many threads that can each send messages to (and receive messages from) each other. The obvious way to do this would be to have a shared array of Tids, but this

Re: std.concurrency thread communication problem

2014-05-17 Thread Ali Çehreli via Digitalmars-d-learn
On 05/17/2014 12:33 PM, John Colvin wrote: On Saturday, 17 May 2014 at 18:43:25 UTC, Charles Hixson via Digitalmars-d-learn wrote: I'm building a program which I intend to have many threads that can each send messages to (and receive messages from) each other. The obvious way to do this would

Re: Array!T and find are slow

2014-05-17 Thread Jonathan M Davis via Digitalmars-d-learn
On Fri, 16 May 2014 11:51:31 -0400 Steven Schveighoffer via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Fri, 16 May 2014 11:36:44 -0400, Jonathan M Davis via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Thu, 15 May 2014 08:04:59 -0300 Ary Borenszweig

Re: D Newbie Trying to Use D with Major C Libraries

2014-05-17 Thread Tom Browder via Digitalmars-d-learn
On Sat, May 17, 2014 at 2:28 PM, Mengu via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: On Friday, 16 May 2014 at 18:19:45 UTC, Alex Herrmann wrote: ... integrates okay with dub too. There is also an emacs major mode for d (d-mode) which gives basic highlighting and indentation

Re: Array!T and find are slow

2014-05-17 Thread w0rp via Digitalmars-d-learn
On Saturday, 17 May 2014 at 20:06:03 UTC, Jonathan M Davis via Digitalmars-d-learn wrote: But I think that the correct solution is to improve the compiler with regards to lazy. The fact that lazy is so slow is a serious problem, and enforce is just one manifestation of it (albeit the worst

Re: std.concurrency thread communication problem

2014-05-17 Thread Charles Hixson via Digitalmars-d-learn
On Saturday, May 17, 2014 12:59:22 PM Ali Çehreli via Digitalmars-d-learn wrote: On 05/17/2014 12:33 PM, John Colvin wrote: On Saturday, 17 May 2014 at 18:43:25 UTC, Charles Hixson via Digitalmars-d-learn wrote: I'm building a program which I intend to have many threads that can each

randomSample

2014-05-17 Thread David Held via Digitalmars-d-learn
How do I get an array from randomSample()? int[] source = [ ... ]; int[] sample = randomSample(source, 3); src\main.d(30): Error: cannot implicitly convert expression (randomSample(source, 3u)) of type RandomSample!(int[], void) to int[] I get that RandomSample is a struct which implements

Re: randomSample

2014-05-17 Thread David Held via Digitalmars-d-learn
On 5/17/2014 9:18 PM, David Held wrote: How do I get an array from randomSample()? int[] source = [ ... ]; int[] sample = randomSample(source, 3); src\main.d(30): Error: cannot implicitly convert expression (randomSample(source, 3u)) of type RandomSample!(int[], void) to int[] [...] Even

Re: randomSample

2014-05-17 Thread Meta via Digitalmars-d-learn
On Sunday, 18 May 2014 at 04:19:05 UTC, David Held wrote: How do I get an array from randomSample()? int[] source = [ ... ]; int[] sample = randomSample(source, 3); src\main.d(30): Error: cannot implicitly convert expression (randomSample(source, 3u)) of type RandomSample!(int[], void) to