summaryrefslogtreecommitdiff
path: root/src/clj
diff options
context:
space:
mode:
authorRich Hickey <richhickey@gmail.com>2009-03-17 12:54:07 +0000
committerRich Hickey <richhickey@gmail.com>2009-03-17 12:54:07 +0000
commitf015ab4f71a680f6c526a17e61f41da9529597bf (patch)
tree3e28cb99977b6373cbd3cb694757a8f7d84951ef /src/clj
parent63a0c31264186f4072a98bb1b9bf98dea17c8e35 (diff)
made (empty aseq) -> (), (empty non-IPersistentCollection) -> nil
Diffstat (limited to 'src/clj')
-rw-r--r--src/clj/clojure/core.clj5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/clj/clojure/core.clj b/src/clj/clojure/core.clj
index 56db96b3..397ca177 100644
--- a/src/clj/clojure/core.clj
+++ b/src/clj/clojure/core.clj
@@ -3154,8 +3154,9 @@
(defn empty
"Returns an empty collection of the same category as coll, or nil"
- [#^clojure.lang.IPersistentCollection coll]
- (.empty coll))
+ [coll]
+ (when (instance? clojure.lang.IPersistentCollection coll)
+ (.empty #^clojure.lang.IPersistentCollection coll)))
(defmacro amap
"Maps an expression across an array a, using an index named idx, and