dissoc[iate]. Returns a new map of the same (hashed/sorted) type,
that does not contain a mapping for key(s).
user=> (dissoc {:a 1 :b 2 :c 3}) ; dissoc nothing
{:a 1, :b 2, :c 3}
user=> (dissoc {:a 1 :b 2 :c 3} :b) ; dissoc key :b
{:a 1, :c 3}
user=> (dissoc {:a 1 :b 2 :c 3} :d) ; dissoc not existed key
{:a 1, :b 2, :c 3}
user=> (dissoc {:a 1 :b 2 :c 3} :c :b) ; several keys at once
{:a 1}
Dissociates an entry from a nested associative structure returning a
(defn dissoc
"dissoc[iate]. Returns a new map of the same (hashed/sorted) type,
that does not contain a mapping for key(s)."
{:added "1.0"
:static true}
([map] map)
([map key]
(. clojure.lang.RT (dissoc map key)))
([map key & ks]
(let [ret (dissoc map key)]
(if ks
(recur ret (first ks) (next ks))
ret))))
Comments top
No comments for dissoc. Log in to add a comment.