[Issue 11572] New: eager apply for ranges

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Nov 21 12:43:33 PST 2013


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

           Summary: eager apply for ranges
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: code at dawg.eu


--- Comment #0 from Martin Nowak <code at dawg.eu> 2013-11-21 12:43:30 PST ---
The use-case

foreach (c; "foobar".retro())
    writeln(c);

"foobar".retro.apply!writeln();

This is not a functional component because it's mostly useful for void
functions with side effect. Currently one needs to mix foreach and UFCS.

Not sure about the name, maybe sink or apply.
Or we could modify std.algorithm.reduce to allow void functions.

NB: The function is not supposed to produce a result (we have
http://dlang.org/phobos/std_array.html#.array for that).

-- 
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