function | since v0.0-927 | clojure.core/empty | Edit |
(empty coll)
Returns an empty collection of the same category as coll
.
Returns nil if coll
is nil.
Returns an empty collection of the same category as coll, or nil
(defn empty
[coll]
(when-not (nil? coll)
(cond
(implements? IEmptyableCollection coll)
(-empty coll)
(satisfies? IEmptyableCollection coll)
(-empty coll)
:else nil)))