In this blog entry, "CSP and transducers in JavaScript", the author states:
First, we have to realise that many array (or other collection) operations like
map
,filter
andreverse
can be defined in terms of areduce
.
So then we see a number of implementations of this in Clojure aren't lazy, they are eager:
user> (defn eager-map [f coll]
(reduce (fn [acc v] (conj acc (f v)))
[]
coll))
#'user/eager-map
user> (eager-map inc (range 10))
[1 2 3 4 5 6 7 8 9 10]
My question is, are Clojure transducers eager?