;; *** before: ***
;; each step builds a fully realized intermediate sequence,
;; and the whole pipeline is tied to a lazy seq of a coll
(->> [1 2 3 4 5]
(map inc)
(filter even?)
(reduce +))
;=> 12
;; *** in version 1.7: ***
;; dropping the collection argument turns map/filter into a
;; transducer - a transformation independent of any source
(def xf (comp (map inc) (filter even?)))
;; transduce applies it eagerly, with no intermediate seqs at all
(transduce xf + [1 2 3 4 5])
;=> 12
;; the same xf also works with into, sequence, or a core.async channel
(into [] xf [1 2 3 4 5])
;=> [2 4 6]