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

0 votes
in Clojure by

These two suppose to be the same:

(transduce (comp (take 10) (partition-all 3)) conj (range))
;; => (link: [0 1 2) (link: 3 4 5) (link: 6 7 8) (link: 9])

(reduce conj (r/reducer (range) (comp (take 10) (partition-all 3))))
;; => (link: [0 1 2] [3 4 5] [6 7 8])

Reason being r/reducer is not currently respecting the 1-arity case of xf.

2 Answers

0 votes
by
_Comment made by: glts_

It’s the same with plain {{reduce}}:


(reduce ((partition-all 3) conj) [] (range 10))
; => [[0 1 2] [3 4 5] [6 7 8]]


I believe completion is a feature of {{transduce}}, not necessarily of other transducible processes.
0 votes
by
Reference: https://clojure.atlassian.net/browse/CLJ-2338 (reported by gzmask)
...