Created
March 23, 2012 19:02
-
-
Save hussein/2173859 to your computer and use it in GitHub Desktop.
mutating in Clojure
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
(let [master (get-it-some-where) | |
slave (atom (:slave master))] | |
;; faked logic | |
(if (< 0.7 (rand)) | |
(swap! slave assoc :status :success) | |
;; save to mongo | |
)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment