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

0 votes
in Transducers by

I found that the eduction example in clojuredocs does not work with Clojure 1.10.3

user=> (reduce + (eduction (map inc) (range 3)))
Execution error (ClassCastException) at user/eval149 (REPL:1).
clojure.core.Eduction cannot be cast to clojure.lang.IReduce

eduction does not work with reduce function anymore? or is it kind of bug?

With a default value, it works again.

user=> (reduce + 0 (eduction (map inc) (range 3)))
6

1 Answer

0 votes
by

Nothing has changed here - eduction has always been implemented only with IReduceInit. The clojuredocs example is wrong.

...