Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@hussein
Created March 23, 2012 19:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hussein/2173859 to your computer and use it in GitHub Desktop.
Save hussein/2173859 to your computer and use it in GitHub Desktop.
mutating in Clojure
(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