Created
March 22, 2020 15:52
-
-
Save dominem/14ba93be3916f7e5f3dca094f3def3c0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn my-update-in | |
[m ks f & args] | |
(assoc-in m ks (apply f (cons (get-in m ks) args)))) | |
(comment | |
(my-update-in {:author {:name "Dominik"}} [:author] vec) | |
;; => {:author [[:name "Dominik"]]} | |
(my-update-in {:author {:name "Dominik"}} [:author :name] str " Magdalenski") | |
;; => {:author {:name "Dominik Magdalenski"}} | |
(my-update-in {} [:author :name] str " Magdalenski") | |
;; => {:author {:name " Magdalenski"}} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment