Welcome! Please see the About page for a little more info on how this works.

0 votes
in Clojure by

It would be nice to have a reducers implementation of the core reductions function.

Initial implementation attempt included. This version requires an initial reduction value parameter (vs using (f)) and includes that initial value in the final reduction. I'm not certain either of these decisions is optimal, but results in a function which most closely mimics clojure.core/reductions.

2 Answers

0 votes
by

Comment made by: jafingerhut

Patch reductions-reducer.diff dated Nov 23 2012 no longer applies cleanly to latest master after some commits were made to Clojure on Sep 3, 2014.

I have not checked whether this patch is straightforward to update, nor do I know if there is interest in an updated patch, or whether transducers are the preferred way to go over reducers, and thus all reducers-related tickets will be closed. See the section "Updating stale patches" at http://dev.clojure.org/display/community/Developing Patches for suggestions on how to update patches.

0 votes
by
Reference: https://clojure.atlassian.net/browse/CLJ-1113 (reported by llasram)
Welcome to Clojure Q&A, where you can ask questions and receive answers from members of the Clojure community.
...