reduce -> fold?

Chris Wright via Digitalmars-d digitalmars-d at puremagic.com
Fri Jan 29 10:50:34 PST 2016


On Fri, 29 Jan 2016 07:08:01 -0500, Andrei Alexandrescu wrote:

> As has been discussed before there's been discussion about
> std.algorithm.reduce taking the "wrong" order of arguments (its
> definition predates UFCS). I recall the conclusion was there'd be subtle
> ambiguities if we worked reduce to implement both orders.
> 
> So the next best solution is to introduce a new name such as the popular
> "fold", and put them together in the documentation.
> 
> 
> Thoughts?
> 
> Andrei

For my own sake, I don't care at all. I've seen this announcement, I'll 
see deprecation warnings, so the change doesn't really bother me. A minor 
irritation that I'd have to change a couple lines of code, that's all.

I always call reduce with UFCS (same with almost everything in 
std.algorithm), so the parameter order doesn't affect me.


More information about the Digitalmars-d mailing list