Closed jpotterm closed 10 years ago
At first glance, I do believe that this would be a good change. Does anyone else have any reservations for making this breaking change? If not, then I'd say go ahead with the implementation.
I agree with this change. For what it's worth, that's also the way Clojure implements reduce
: http://clojuredocs.org/clojure_core/clojure.core/reduce
+1. Definitely the most appropriate order.
On Mon, Mar 10, 2014 at 5:36 PM, Dillon Forrest notifications@github.comwrote:
I agree with this change. For what it's worth, that's also the way Clojure implements reduce: http://clojuredocs.org/clojure_core/clojure.core/reduce
Reply to this email directly or view it on GitHubhttps://github.com/eliperelman/fn.js/issues/12#issuecomment-37237573 .
Great, if someone would like to submit a pull request, I'd be happy to review it.
This is now in 0.7.0
. Remember that this is a breaking change, so upgrading will mean needing to change the order of fn.reduce
arguments. Thanks everyone!
I think it would be beneficial to move the
accumulator
to be the second argument tofn.reduce
:This would let us do things like:
I think it makes sense to have the
accumulator
near thehandler
because it is almost always the identity value of the function being used to accumulate.If you think this is a good idea, I'd be happy to submit a pull request with this change.