Issue 9148

bearophile via Digitalmars-d digitalmars-d at puremagic.com
Sat Apr 26 03:27:30 PDT 2014


Jonathan M Davis:

> However, I'm not sure that treating it as weakly pure buys
> us anything except in the case where we're trying to make
> the outer function pure as well.

Here is a bit more realistic example of the problem, currently 
this (rather common) code doesn't compile:


import std.algorithm, std.array, std.range;

int[] foo(in int[] data) pure {
     auto indexes = iota(int(data.length));
     return indexes.map!(i => i * data[i]).array;
}
void main() {}


Bye,
bearophile


More information about the Digitalmars-d mailing list