Someone could (and hopefully will) write a multi-hundred-page book exclusively on Clojure's approach to state. I simply didn't have enough space while overviewing the whole language.

If you want an identity that is isolated from whatever else is (or might in the future) happen in your app, prefer atoms. However, if it does (or will) coordinate with other identities, use refs.

I guess switching between these should be a feature of the Clojure Refactoring IDE. :-)

Stu

For a single value
there seems to be little reason to adopt refs, though I've often
wondered why Stuart Halloway's book gives an example updating a single
ref of messages for a chat application.

I seem to recall atoms being the last reference type to be introduced. They might not have existed when Stuart was writing.

--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to