http://d.puremagic.com/issues/show_bug.cgi?id=8755
Summary: Change the order of reduce arguments Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: enhancement Priority: P2 Component: Phobos AssignedTo: nob...@puremagic.com ReportedBy: adamsib...@hotmail.com --- Comment #0 from adamsib...@hotmail.com 2012-10-04 09:03:45 PDT --- Reduce cannot have a seed applied elegantly when used with UFCS due to the argument order being range, seed. A newly named version with the argument order reversed would allow the use of the full range of reduce's capabilities with UFCS arguments. Suggestion: auto fold(range, seed) {} to allow: [1,2,3,4,5].fold!((a, b) => a + b * b)(0).writeln; With the possibility of a longer chain in place of the array argument, a normal use with UFCS. At present only a few uses such as sum, max and min are usable with the unseeded form, limiting the usefulness of reduce. Giving it a default of "a + b" would also improve its use as summing is probably the most common use case. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------