In its current form, std.algorithm.reduce takes optional seed value(s) 
for the accumulator(s) as its first argument(s). This breaks the nice 
chaining effect made possible by UFCS:

Works:
-----------------------------------------
auto foo = reduce!((string s, string x) => s ~= x)("BLAH", args.map!(x => 
x[1..$-1]));
-----------------------------------------

Doesn't work, but looks much nicer:
-----------------------------------------
auto foo = args.map!(x => x[1..$-1]))
               .reduce!((string s, string x) => s ~= x)("BLAH");
-----------------------------------------

This could be fixed with a breaking change by making the subject range to 
be the first parameter. Aside from breaking existing code, are there 
other obstacles to changing this?

Justin Whear

Reply via email to