Why not extend array operations to full Fortran90 power ?

Xinok xinok at live.com
Thu Nov 17 10:48:07 PST 2011


On 11/16/2011 2:08 PM, Joachim Wuttke <j.wuttke at fz-juelich.de> wrote:
>    (1)  Y[] = X[]*X[];
>    (2)  Y[] = sin( X[] );

I realized a problem with (2), it's actually not possible to rewrite it 
using existing constructs because foreach doesn't support multiple 
iterators. You can use std.range.zip:

foreach(i; zip(Y, X)) i[0] = sin(i[1]);

But it's not a core language feature. Before we could extend array 
operations to support the example above, I think D would need native 
support for multiple iterators.


More information about the Digitalmars-d mailing list