I'm pretty sure there has to be a more idiomatic way of writing this:
(defn update-2nd-level-vector
[map index value]
(assoc map :key1 (assoc (get map :key1) :key2 (-> map (get-in [:key1 :key2]) (assoc index value)))))
Example of its working:
=> (update-2nd-level-vector {:key1 {:key2 [0 1]}} 0 1)
{:key1 {:key2 [1 1]}}
update-in
. – Jeremy Jul 26 '14 at 16:49