Skip to content

Instantly share code, notes, and snippets.

@michaelklishin
Created May 2, 2012 11:31
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 michaelklishin/747fd0d63e25b2fc1ebf to your computer and use it in GitHub Desktop.
Save michaelklishin/747fd0d63e25b2fc1ebf to your computer and use it in GitHub Desktop.
=> (def m (ref {:a #{} :b #{}}))
=> (dosync (alter m assoc :c #{}))
{:c #{}, :a #{}, :b #{}}
=> @m
{:c #{}, :a #{}, :b #{}}
=> (dosync (alter m update-in [:a] conj 1))
{:c #{}, :a #{1}, :b #{}}
=> (dosync (alter m update-in [:a] conj 2))
{:c #{}, :a #{1 2}, :b #{}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment