[Issue 11412] Allow nested pure functions to access outer function variables

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Nov 14 03:35:00 PST 2013


https://d.puremagic.com/issues/show_bug.cgi?id=11412



--- Comment #1 from Denis Shelomovskij <verylonglogin.reg at gmail.com> 2013-11-14 14:34:57 MSK ---
This enhancement is important as currently lots of `std.algorithm`/`std.range`
stuff can't used in `pure` functions because of closures:
---
import std.algorithm, std.range;

size_t notXCount(in int[] arr, int x) pure
{
    return arr
        .filter!(n => n != x)()
        .walkLength(); // currently error as predicate is impure
}
---

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list