Thanks for the reply.  I wasn't trying to be critical.  I have a similar
situation where I'm using an atom instead of a ref, and wanted to make sure
I wasn't missing anything in my understanding of refs vs. atoms.

I am using clojure-http currently and it works quite well, thank you!  It's
very easy to use.   Also I've learned a lot by looking at the code, which is
clear and well written.

Steve


On Mon, Jun 14, 2010 at 4:56 PM, Phil Hagelberg <p...@hagelb.org> wrote:

> On Fri, Jun 11, 2010 at 8:45 AM, Steve Molitor <stevemoli...@gmail.com>
> wrote:
> > I'm a clojure newbie trying to understand when to use atoms versus refs.
> > In clojure-http.resourcefully, if you use the with-cookies macro stores
> the
> > cookies in a thread local ref.  Why a ref and not an atom?  My impression
> is
> > that refs are for when you need to coordinate changes to more than one
> > variable, or maybe if you need triggered validations.
>
> Actually you're correct; an atom would be better here. I wrote that
> code a long time ago and haven't used or looked at it since, but
> there's absolutely no reason to pull in the STM for state changes like
> that.
>
> -Phil
>
> --
> 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<clojure%2bunsubscr...@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