function | since v0.0-927 | clojure.core/coll? | Edit |
(coll? x)
Returns true if x
is a collection, false otherwise.
Lists, maps, sets, and vectors are collections.
(coll? [1 2 3])
;;=> true
(coll? '(1 2 3))
;;=> true
(coll? #{1 2 3})
;;=> true
(coll? {:foo 1 :bar 2})
;;=> true
Not collections:
(coll? "foo")
;;=> false
(coll? 123)
;;=> false
(coll? nil)
;;=> false
Returns true if x satisfies ICollection
(defn coll?
[x]
(if (nil? x)
false
(satisfies? ICollection x)))