I think part of the problem is that commute should not return any result.
You are not sure this is actually the value that will be returned,
this is costly
and misleading.
There should be at least a variant of commute that return nil.
--
You received this message because you are subscribed to
Hi,
The duplicate computation in commute seems to me quite a blemish on
clojure's beauty. I even see somebody's code with comments pre-
compute x because otherwise commute will call it twice. So I need to
keep that fact in the back of my mind when using it? That is not what
I was hoping for.
I
a conflict.
All this doesn't mean that it's impossible to avoid the duplicate
computation on `commute`. The code to study would be here:
https://github.com/clojure/clojure/blob/8fda34e4c77cac079b711da59d5fe49b74605553/src/jvm/clojure/lang/LockingTransaction.java#L459
-S
--
You received
if there's a conflict.
All this doesn't mean that it's impossible to avoid the duplicate
computation on `commute`. The code to study would be here:
https://github.com/clojure/clojure/blob/8fda34e4c77cac079b711da59d5fe49b74605553/src/jvm/clojure/lang/LockingTransaction.java#L459
-S
--
You
more than once if there's a conflict.
All this doesn't mean that it's impossible to avoid the duplicate
computation on `commute`. The code to study would be here:
https://github.com/clojure/clojure/blob/8fda34e4c77cac079b711da59d5fe...
-S
--
You received this message because you
to avoid the duplicate
computation on `commute`. The code to study would be here:
https://github.com/clojure/clojure/blob/8fda34e4c77cac079b711da59d5fe.
..
-S
--
You received this message because you are subscribed to the Google
Groups Clojure group.
To post to this group
once, you can
use
`alter`.
Keep in mind that *any* code in a Ref transaction has the potential to
be
called more than once if there's a conflict.
All this doesn't mean that it's impossible to avoid the duplicate
computation on `commute`. The code to study would be here
in a Ref transaction has the
potential to
be
called more than once if there's a conflict.
All this doesn't mean that it's impossible to avoid the duplicate
computation on `commute`. The code to study would be here:
https://github.com/clojure/clojure/blob