Using swap to MERGE (append to) a nested map in a Clojure atom? -
let's have atom contains map this:
{:count 0 :map hash-map}
how can use swap merge key-value pair onto :map
?
you'd use assoc-in
:
(swap! my-atom assoc-in [:map :new-key] value)
Comments
Post a Comment