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