function | since v0.0-1211 | clojure.core/filterv | Edit |
(filterv pred coll)
Returns a vector of the items in coll
for which (pred item)
returns true.
pred
must be free of side-effects.
Returns a vector of the items in coll for which (pred item) returns logical true. pred must be free of side-effects.
(defn filterv
[pred coll]
(-> (reduce (fn [v o] (if (pred o) (conj! v o) v))
(transient [])
coll)
persistent!))