Jumping to the right, the best way to do this:
(assoc-in
{:children [{:children [{:children [{:children [{:children []}]}]}]}]}
[:children 0 :children 0 :children 0 :children 0 :children 0]
:hello)
I want to insert :hellointo the deepest :childrenvector. Above I do this with help assoc-in.
Is there a better way than that assoc-in?
Or , if , when assoc-inis the only way, how would you handle assoc-inthe 2nd argument [k & ks]?
It's also good to know if there is something there that also works for inserting :worldinto an arbitrary vector :children... like a 3rd child or 2nd child of a 1st child.
source
share