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
