On 11/16/2011 2:08 PM, Joachim Wuttke <j.wut...@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.

Reply via email to