Mike is correct.  This change in behavior is due to the hashing changes in
Clojure 1.6.  See the comments on ticket
http://dev.clojure.org/jira/browse/CLJ-1372 for some discussion of whether
this is considered a bug.  It appears that perhaps the hash consistency is
not promised for mutable objects, only immutable ones.

Below are a couple more REPL transcripts that illustrate the change in
behavior:

user=> *clojure-version*
{:major 1, :minor 5, :incremental 1, :qualifier nil}
user=> (= [1 2] (java.util.ArrayList. [1 2]))
true
user=> (map hash [ [1 2] (java.util.ArrayList. [1 2]) ])
(994 994)
user=> (hash-map [1 2] "vec" (java.util.ArrayList. [1 2]) "alist")
{[1 2] "alist"}



user=> *clojure-version*
{:major 1, :minor 6, :incremental 0, :qualifier nil}
user=> (= [1 2] (java.util.ArrayList. [1 2]))
true
user=> (map hash [ [1 2] (java.util.ArrayList. [1 2]) ])
(156247261 994)
user=> (hash-map [1 2] "vec" (java.util.ArrayList. [1 2]) "alist")
{[1 2] "alist", [1 2] "vec"}


Andy


On Fri, May 9, 2014 at 3:18 PM, Mike Fikes <mikefi...@me.com> wrote:

> Perhaps this is a consequence of the hashing changes in 1.6. (
> http://dev.clojure.org/display/design/Better+hashing)
>
> --
> 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
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to clojure+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to