diff options
author | Rich Hickey <richhickey@gmail.com> | 2008-06-10 11:20:32 +0000 |
---|---|---|
committer | Rich Hickey <richhickey@gmail.com> | 2008-06-10 11:20:32 +0000 |
commit | 093ab1e4c0b48ee7607b96688584f6800760f2ad (patch) | |
tree | e1393c2dc56457622ec955aaed576beabe8f7b8b | |
parent | 049b6b071da0d96d50b99a82817fdfa5e6f60204 (diff) |
fixed partition
-rw-r--r-- | src/boot.clj | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/boot.clj b/src/boot.clj index 55dca185..ad0cf15a 100644 --- a/src/boot.clj +++ b/src/boot.clj @@ -2499,9 +2499,10 @@ not-every? (comp not every?)) ([n coll] (partition n n coll)) ([n step coll] - (take-while #(= n (count %)) - (when (seq coll) - (lazy-cons (take n coll) (partition n step (drop step coll))))))) + (when (seq coll) + (let [p (take n coll)] + (when (= n (count p)) + (lazy-cons p (partition n step (drop step coll)))))))) (defmacro definline "Experimental - like defmacro, except defines a named function whose |