[Issue 11555] New: std.algorithm.reverse should return the just-reversed range
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Nov 19 10:48:18 PST 2013
https://d.puremagic.com/issues/show_bug.cgi?id=11555
Summary: std.algorithm.reverse should return the just-reversed
range
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: andrei at erdani.com
--- Comment #0 from Andrei Alexandrescu <andrei at erdani.com> 2013-11-19 10:48:14 PST ---
>From communication with Chuck Allison:
Bearophile mentioned that .reverse was deprecated. The problem with that is
that std.algorithm.reverse doesn’t return anything, breaking code like:
auto compose_n(Fun)(Fun[] funs) pure {
alias T = ReturnType!Fun;
return (T x) => reduce!((sofar,f) => f(sofar))(x,funs.dup.reverse); // <==
uses .reverse
}
I now about std.functional.compose, but that’s not the point. For functional
programming, we need values returned for cases like this.
Thoughts?
--
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