http://d.puremagic.com/issues/show_bug.cgi?id=4729

           Summary: std.algorithm: atrange iota behaviour
           Product: D
           Version: D2
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Optlink
        AssignedTo: nob...@puremagic.com
        ReportedBy: necrom...@gmail.com


--- Comment #0 from Max Klyga <necrom...@gmail.com> 2010-08-26 05:16:40 PDT ---
import std.stdio, std.algorithm, std.range;

void main() {
    filter!((int n) { write(n, ' '); return 0; })(iota(1, 10));
    //writes: 1 2 3 4 5 6 7 8 9

    writeln();

    reduce!"0"(
        filter!((int n) { write(n, ' '); return 1; })(iota(1, 10))
    ); //writes: 1 2 3 4 5 6 7 8 9

    writeln();

    reduce!"0"(
        filter!((int n) { write(n, ' '); return 0; })(iota(1, 10))
    ); //Never stops writing numbers
}

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

Reply via email to