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

Popular posts from this blog

google app engine - 403 Forbidden POST - Flask WTForms -

ruby on rails - In a controller spec, how to find a specific tag in the generated view? -