/gist:67d1cc3236b3732df852 Secret
Last active
December 10, 2015 15:58
-
-
Save hiredman/67d1cc3236b3732df852 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 get-instance [m k] | |
(dosync | |
(alter m (fn [x] (if (contains? x k) x (assoc x k (create-some-instance))))) | |
(get @m k))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment