2014-04-26 19:27 GMT+09:00 bearophile via Digitalmars-d <
[email protected]>:
> 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() {}
>
https://github.com/D-Programming-Language/dmd/pull/3626
Kenji Hara