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

0 votes
in Clojure by

First, core.reducers requires clojure.walk :as walk, but does not use the alias.
Second, the two arity implementation of coll-reduce in function reducer uses 'this', whereas similar implementations in that file use 'coll'. AFAICT it makes no difference to use 'coll' (all tests pass, no change in performance) and it is more in line with the rest of the code.

The two things seem small enough to be put into one cleanup case.

5 Answers

0 votes
by

Comment made by: wagjo

your patch is wrong. If you want to replace this with coll, you have to allso call xf on f1.

`(clojure.core.protocols/coll-reduce this f1 (f1))`

becomes

`(clojure.core.protocols/coll-reduce coll (xf f1) (f1))`

0 votes
by

Comment made by: ska2342

Scary, that the test suite did not detect that.

0 votes
by

Comment made by: jafingerhut

Is it straightforward to add a test that would have detected that?

0 votes
by

Comment made by: ska2342

I will happily look into that. It may take a few days, before I'll find the time, though.

0 votes
by
Reference: https://clojure.atlassian.net/browse/CLJ-1151 (reported by ska2342)
...