clojure - Update-in nested map -


i'm new clojure , i've been staring @ time, i'm sure there's basic don't see. want conj 2 sets, they're nested, example:

(def foo {:b #{:test}}) (def bar {:a {:b #{:ab}} :c :d}) 

i tried:

=>(update-in bar [:a :b] conj (:b foo) ) {:a {:b #{#{:test} :ab}}, :c :d} 

i guess makes sense, wanted {:a {:b #{:test :ab}}, :c :d}

i can't seem how either #{:test} out of set conj it, or access :b set given update-in syntax.

any enormously appreciated.

you need use into instead of conj:

(update-in bar [:a :b] (:b foo)) ;= {:a {:b #{:test :ab}}, :c :d} 

Comments

Popular posts from this blog

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -