It seems like a pure efficiency optimization - used alone it doesn't
change semantics from dosync and alter over one ref.

It makes me feel wary. What if I changed my design and wanted to do
more in the same transaction? What if I later wanted to call a
function that uses it in the scope of a wider transaction? Or a
transaction that might retry? What if this was library code beyond my
power to alter?

On the other hand I understand how it could be hugely simpler and
quicker, and sometimes an immediate synchronous change is the right
design.

Perhaps it ought to have a warning sticker. "This is a side-effecting,
transaction-breaking blunt instrument contagious to any function that
calls it. Prefer using a ref, especially in library code".

On Dec 5, 1:02 am, Rich Hickey <[EMAIL PROTECTED]> wrote:
> I've added a new reference type - atom.
>
> Docs here:
>
> http://clojure.org/atoms
>
> Feedback welcome,
>
> Rich

--~--~---------~--~----~------------~-------~--~----~
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
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to