It's because of the take-while which is indirectly called at each lazy-cons.
Here is an easy fix:
(defn partition
"Returns a lazy sequence of lists of n items each, at offsets step
apart. If step is not supplied, defaults to n, i.e. the partitions
do not overlap."
([n coll]
(partition n n coll))
([n step coll]
(take-while #(= n (count %))
((fn this [coll]
(when (seq coll)
(lazy-cons (take n coll) (this (drop step coll))))) coll))))
Or, maybe better, to get rid of the take-while entirely:
(defn partition
"Returns a lazy sequence of lists of n items each, at offsets step
apart. If step is not supplied, defaults to n, i.e. the partitions
do not overlap."
([n coll]
(partition n n coll))
([n step coll]
(let [hd (take n coll)]
(if (= n (count hd))
(lazy-cons hd (partition n step (drop step coll)))))))
Christophe