if-expressions

Jarrett Billingsley kb3ctd2 at yahoo.com
Mon May 28 19:49:56 PDT 2007


"Daniel Keep" <daniel.keep.lists at gmail.com> wrote in message 
news:f3g2kl$2tj7$1 at digitalmars.com...
> In any case, it's something I'd definitely like to see in D.  Hell, I'd
> also like to see this:
>
> double[] as = [1.,2.,3.,4.,5.];
> double[] bs = foreach(a;as) a*a;

That looks like it could be done with array operations (defined, but not 
implemented):

double[] as = [1, 2, 3, 4, 5];
double[] bs = as[] * as[]; // or maybe as * as 





More information about the Digitalmars-d mailing list