;; The output will not necessarily be of the same JVM class as the input user=> (class (seq [1])) clojure.lang.PersistentVector$ChunkedSeq user=> (class (empty (seq [1]))) clojure.lang.PersistentList$EmptyList
(defn empty
"Returns an empty collection of the same category as coll, or nil"
{:added "1.0"
:static true}
[coll]
(when (instance? clojure.lang.IPersistentCollection coll)
(.empty ^clojure.lang.IPersistentCollection coll)))
Comments top
No comments for empty. Log in to add a comment.