Skip to content

Instantly share code, notes, and snippets.

@zane
Last active August 29, 2015 14:06
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 zane/d28a4b49935dd23d7612 to your computer and use it in GitHub Desktop.
Save zane/d28a4b49935dd23d7612 to your computer and use it in GitHub Desktop.
(defn f
"Sets the value of ref r to x. Returns true if the new value of
r is different from the old value."
[r x]
(dosync
(let [old @r]
(ref-set r x)
(not= old x))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment