Issue 9148

Kenji Hara via Digitalmars-d digitalmars-d at puremagic.com
Thu Jun 5 20:24:56 PDT 2014


2014-04-26 19:27 GMT+09:00 bearophile via Digitalmars-d <
digitalmars-d at puremagic.com>:

> 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20140606/f3738c85/attachment.html>


More information about the Digitalmars-d mailing list