Jared wrote:
I'm a little confused over when to use a var vs. a ref vs. an agent
vs. an atom. For writing small (<200 lines) single-threaded programs
when do I want to use each one?

ref - When you need to mutate multiple things together synchronously.
atom - When you need to mutate a single thing synchronously.
agent - When you need to mutate a single thing asynchronously.
var - Only for top level bindings which can be mutated globally or on a per-thread basis.

All of the above are thread-safe and can be used to build concurrent applications; which one you choose is entirely your decision.

Clojure provides you all the tools that you *might* need. You just have to be responsible about using those tools.

Hope that helps. Shoot back if you have more questions.

Regards,
BG

--
Baishampayan Ghose <b.gh...@ocricket.com>
oCricket.com

--
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