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: nob...@puremagic.com
        ReportedBy: c...@dawg.eu


--- Comment #0 from Martin Nowak <c...@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: -------

Reply via email to