Affects Version/s: None
Fix Version/s: None
Patch:Code and Test
clojure.core.reducers/fold currently does not work correctly if both a reducef and combinef are passed as arguments.
It is expected that (r/fold + + [1 2 3]) would return 6 (as do (r/fold + [1 2 3]) and (r/reduce + [1 2 3])). However, this is not the case because reducers.cljs currently defines fold as follows:
(def fold reduce)
As a result, the second + is used as the initial value for the reduce operation (instead of the value returned by ).
The attached patch fixes this bug. It also adds support for the protocol CollFold in CLJS.
(I will send in the CA tomorrow.)
|Status||Open [ 1 ]||Resolved [ 5 ]|
|Resolution||Completed [ 1 ]|
|Status||Resolved [ 5 ]||Closed [ 6 ]|