Re: When to use (ensue) ?

2014-06-26 Thread Linus Ericsson
See points 2, 3 and 8 at http://clojure.org/refs It is just a way to obtain the change lock of the ref in the dosync transaction, without rewriting it. The alternative would be to explicitly modify it to the same value as it was before, which is potentially wasteful. One possible case where this

When to use (ensue) ?

2014-06-19 Thread Hussein B.
Hi, When dealing with Clojure ref types, when to use (ensure) ? Thanks. -- 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

When to use (ensue) ?

2014-06-19 Thread Patrick Kristiansen
I believe it is to avoid write skew. Check this Wikipedia page: http://en.m.wikipedia.org/wiki/Snapshot_isolation -- 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

Re: When to use (ensue) ?

2014-06-19 Thread juan.facorro
Hi Hussein, Maybe this StackOverflow QA can help in understanding when to use *ensure* : Clojure STM ambiguity factor http://stackoverflow.com/a/17197281/519383. HTH, Juan On Thursday, June 19, 2014 10:35:24 AM UTC-3, Hussein B. wrote: Hi, When dealing with Clojure ref types, when to use