fill array using a lambda function

2013-10-10 Thread dominic jones
Hello, I want to fill an array with random numbers without resorting to loops, i.e. by doing something like the following, if it were possible: fill!(function double(){ return uniform(0.0, 1.0);})(x[]); Is there a simple way of doing this? Thank you, Dominic Jones P.S. I am aware of the

operations on rectangular arrays

2012-11-14 Thread dominic jones
e. without using foreach)? And will such statements one day be possible? The section in http://dlang.org/arrays.html on rectangular arrays offers no use cases to follow. Thank you, Dominic Jones

primitive type operator overload

2012-04-20 Thread dominic jones
/src, what I found didn't offer any help. -Dominic Jones

template expressions in C++ to an equivalent in D

2011-10-28 Thread Dominic Jones
looking at function literals, I can't work out what he had in mind with this suggestion. May someone present a succinct complete example to demonstrate how solve this? Many thanks, Dominic Jones

Re: FIFO stack

2011-10-28 Thread Dominic Jones
To conclude the matter regarding the absence of a FIFO stack in the standard library and the not so good alternative of arrays (in particular where there are a significant number of push-pops and the maximum length is not initially known): Does anyone in-the-know know if something like "DList" (a

Re: FIFO stack

2011-10-26 Thread Dominic Jones
> Also an plain array is a good stack. :) I'd rather not use a plain array because (I assume) that when I push or pop using arrays, a swap array is created to resize the original. If this is not the case, then an array will certainly do. -Dominic

FIFO stack

2011-10-26 Thread Dominic Jones
you, Dominic Jones

D programs linked with C/MPI based libraries

2011-04-07 Thread Dominic Jones
, to compile and run C/MPI programs, wrapper commands are used, such as mpicc and mpirun. What would be done in D? Thank you, Dominic Jones

intrinsic min and max for ints

2011-02-16 Thread Dominic Jones
Hello, Is there a library function for min/max for integers. I would rather not use the ?-operator, it's rather clumsy. I looked in the standard lib and only found f(min|max). Thank you, Dominic Jones

Re: using a binary tree container

2011-02-11 Thread Dominic Jones
== Quote from bearophile (bearophileh...@lycos.com)'s article > Dominic Jones: > > I have a list of strings and I want to determine whether or not a particular > > string in the is in that list. > What about using: > size_t[sting] yourStringSet; > Bye, > bearophile

using a binary tree container

2011-02-11 Thread Dominic Jones
documentation for it has no examples. May someone offer an example of how to use it? Thank you, Dominic Jones

allocating an array in an associative array

2011-02-09 Thread Dominic Jones
Hello, I want to allocate the "int[]" array for a particular key in int[][string] list; by doing list[key].length = list[key].length + 1; but it does not work. I get an array bounds error. I am using gdc 4.3.5. Any suggestions? Thank you, Dominic Jones