diff options
author | Rich Hickey <richhickey@gmail.com> | 2007-11-29 15:00:41 +0000 |
---|---|---|
committer | Rich Hickey <richhickey@gmail.com> | 2007-11-29 15:00:41 +0000 |
commit | d20b7e29e987245e7ab13ea0b981bec9bc3ca2c5 (patch) | |
tree | 6e30b3cc6cc2fa4aed0666c47c37058cd1d68bc4 | |
parent | b1da9ba5440902d6de646f5b04f726c7778028e7 (diff) |
fixed bug in concat when passed one collection not returning seq
-rw-r--r-- | src/boot.clj | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/boot.clj b/src/boot.clj index e53d2b80..542a0e28 100644 --- a/src/boot.clj +++ b/src/boot.clj @@ -133,12 +133,14 @@ (defmacro lazy-cons [x & body] (list 'fnseq x (list* 'fn [] body))) - +(defn seq [coll] + (. clojure.lang.RT (seq coll))) + (defn concat ([] nil) ([x & xs] (cond - (nil? xs) x + (nil? xs) (seq x) (nil? x) (recur (first xs) (rest xs)) :else (lazy-cons (first x) (apply concat (rest x) xs))))) @@ -239,8 +241,7 @@ ;;Collection stuff -(defn seq [coll] - (. clojure.lang.RT (seq coll))) + (defn count [coll] (. clojure.lang.RT (count coll))) |