<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2014-04-26 19:27 GMT+09:00 bearophile via Digitalmars-d <span dir="ltr"><<a href="mailto:digitalmars-d@puremagic.com" target="_blank">digitalmars-d@puremagic.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Jonathan M Davis:<div class="">
<br>
<br>
<blockquote class="gmail_quote" style="margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
However, I'm not sure that treating it as weakly pure buys<br>
us anything except in the case where we're trying to make<br>
the outer function pure as well.<br>
</blockquote>
<br></div>
Here is a bit more realistic example of the problem, currently this (rather common) code doesn't compile:<br>
<br>
<br>
import std.algorithm, std.array, std.range;<br>
<br>
int[] foo(in int[] data) pure {<br>
    auto indexes = iota(int(data.length));<br>
    return indexes.map!(i => i * data[i]).array;<br>
}<br>
void main() {}<br></blockquote><div><br></div><div><a href="https://github.com/D-Programming-Language/dmd/pull/3626">https://github.com/D-Programming-Language/dmd/pull/3626</a> </div><div><br></div><div>Kenji Hara</div></div>
</div></div>