On Wed, Dec 1, 2010 at 8:38 AM, Alex Osborne <a...@meshy.org> wrote:
>> I expect the compare it does uses .equals rather than ==?
>
> Not even that, it's a CPU instruction so it'll be identical?.

The identical? predicate and the Java == operator do the same thing.
Also, what's a CPU instruction? Everything we've been discussing is in
Java and/or Clojure, so it'd be a JVM instruction. I think the
.compareAndSet method call in the swap method in the Java code for
Clojure atoms was the specific case under discussion. The snippet you
posted didn't make it clear what method that actually was; it was
invoked on an object held by a reference named "state" but the
variable's declaration wasn't in the snippet so its type is unknown to
me. My guess would be something in the java.util.concurrent package.

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