Created
November 11, 2015 15:41
-
-
Save squeedee/9985567a64dc42627589 to your computer and use it in GitHub Desktop.
Rash learns update-in
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
(update-in {:editor {:name "foo"}} [:editor] (fn [a b] (str a b)) 1) | |
;{:editor "{:name \"foo\"}1"} | |
(update-in {:editor {:name "foo"}} [:editor] (fn [a b] (str (:name a) b)) 1) | |
;{:editor "foo1"} | |
(update-in {:editor {:name "foo"}} [:editor :name] (fn [a b] (str a b)) 1) | |
;{:editor {:name "foo1"}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment