aboutsummaryrefslogtreecommitdiff
path: root/src/clojure/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'src/clojure/contrib')
-rw-r--r--src/clojure/contrib/lazy_seqs.clj14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/clojure/contrib/lazy_seqs.clj b/src/clojure/contrib/lazy_seqs.clj
index 9b40af26..e9915143 100644
--- a/src/clojure/contrib/lazy_seqs.clj
+++ b/src/clojure/contrib/lazy_seqs.clj
@@ -75,12 +75,14 @@
(list nil)))
(defn partition-all
- "Lazily break s into chunks of length n (or less, for the
- final chunk)."
- [n s]
- (when (seq s)
- (lazy-cons (take n s)
- (partition-all n (drop n s)))))
+ "Lazily break coll into chunks of length n (or less, for the final
+ chunk)."
+ ([n coll]
+ (partition-all n n coll))
+ ([n step coll]
+ (when (seq coll)
+ (lazy-cons (take n coll)
+ (partition-all n step (drop step coll))))))
(defn random-permutation
"Return a random permutation of coll"