function | since v0.0-927 | clojure.core/select-keys | Edit |
(select-keys map keyseq)
Returns a map containing only those entries in map
whose key is in keys
.
Returns a map containing only those entries in map whose key is in keys
(defn select-keys
[map keyseq]
(loop [ret {} keys (seq keyseq)]
(if keys
(let [key (first keys)
entry (get map key ::not-found)]
(recur
(if (not= entry ::not-found)
(assoc ret key entry)
ret)
(next keys)))
(-with-meta ret (meta map)))))