summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Hickey <richhickey@gmail.com>2008-01-31 18:55:01 +0000
committerRich Hickey <richhickey@gmail.com>2008-01-31 18:55:01 +0000
commit0ed5a73de68fb3d50d28825f0b0ab5a3ea91468d (patch)
tree5441ff23bd99b5cbf2eb0265aac53e4605b5a551
parent037d1652395349b60194a67887bbb292f77e4d05 (diff)
simplified cycle
-rw-r--r--src/boot.clj12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/boot.clj b/src/boot.clj
index 05c9459a..c5548980 100644
--- a/src/boot.clj
+++ b/src/boot.clj
@@ -556,12 +556,12 @@
coll))
(defn cycle [coll]
- (let [rep (fn [xs ys]
- (if xs
- (lazy-cons (first xs) (rep (rest xs) ys))
- (recur ys ys)))]
- (when (seq coll)
- (rep (seq coll) (seq coll)))))
+ (when (seq coll)
+ (let [rep (fn [xs]
+ (if xs
+ (lazy-cons (first xs) (rep (rest xs)))
+ (recur (seq coll))))]
+ (rep (seq coll)))))
(defn split-at [n coll]
[(take n coll) (drop n coll)])