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

0 votes
in Transducers by
closed 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)))

closed with the note: not a bug or regression, example is wrong

1 Answer

0 votes

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