partitionv-all
function | since v1.11.121 | Edit |
(partitionv-all n)
(partitionv-all n coll)
(partitionv-all n step coll)
Source docstring:
Returns a lazy sequence of vector partitions, but may include
partitions with fewer than n items at the end.
Returns a stateful transducer when no collection is provided.
(defn partitionv-all
([n]
(partition-all n))
([n coll]
(partitionv-all n n coll))
([n step coll]
(lazy-seq
(when-let [s (seq coll)]
(let [seg (into [] (take n) coll)]
(cons seg (partitionv-all n step (drop step s))))))))