Re: Why .dup not work with multidimensional arrays?

2015-05-07 Thread E.S. Quinn via Digitalmars-d-learn
It's because arrays are references types, and .dup is a strictly shallow copy, so you're getting two outer arrays that reference the same set of inner arrays. You'll have to duplicated each of the inner arrays yourself if you need to make a deep copy. On Friday, 8 May 2015 at 02:15:38 UTC, Dennis

std.concurrency: The fate of unmatched messages

2015-07-10 Thread E.S. Quinn via Digitalmars-d-learn
I'm putting together a program that uses std.concurrency to handle two child threads from the main thread; The kicker here is that both the children do very different things. And I would like to handle receive() calls for them in separate locations. But from what I can tell, each thread has o

Re: std.concurrency: The fate of unmatched messages

2015-07-10 Thread E.S. Quinn via Digitalmars-d-learn
On Friday, 10 July 2015 at 23:39:30 UTC, ketmar wrote: this way your `receive` will get all messages. simply do nothing in `Variant` handler to drop messages you don't want to process. [1] http://dlang.org/phobos/std_concurrency.html#.receive The thing is, I want to do receive() in two sepa

Re: std.concurrency: The fate of unmatched messages

2015-07-11 Thread E.S. Quinn via Digitalmars-d-learn
On Saturday, 11 July 2015 at 02:15:02 UTC, ketmar wrote: so simply don't receive the messages you don't need right now. as i said, `receive()` doesn't look to top message only, it scans the whole mailbox, trying to find a message that matches. you can use `receiveTimeout()` to do nothing if t

Re: String Metaprogramming

2015-07-18 Thread E.S. Quinn via Digitalmars-d-learn
On Saturday, 18 July 2015 at 13:48:20 UTC, Clayton wrote: Am new to D programming, am considering it since it supports compile-time function execution . My challenge is how can I re-implement the function below so that it is fully executed in compile-time. The function should result to tabel1 b