I have a structure that I created in REPL,
{1 {10 {:id 101, :name "Paul"}, 20 {}}, 2 {30 {}, 40 {}}, 3 {50 {}, 60 {}}}
and I want to add a new kv to key 1 so that the resulting structure looks like this:
{1 {10 {:id 101, :name "1x2"}, 20 {}, 11 {:id 102, :name "Ringo"}}, 2 {30 {}, 40 {}}, 3 {50 {}, 60 {}}}.
I just opened get-in update-in and assoc-in to work with such nested structures, but I canβt figure out how to add new elements to elements. In my application, this is all wrapped in ref and updated by dosync / alter, but for now I just want to be able to do this on REPL.
I may have just looked at this for too long, but any attempt to use an associative or associative interface simply modifies what already exists and does not add new elements.
source share