> Clojure 1.3.0-alpha* uses its own = function for map lookups specifically to
> avoid this problem.  The = function is true for numbers of different types
> but the same value.  Note that Java code dealing with Clojure maps using the
> java.util.Map interface will still get the standard Java behavior using
> Object.equals.

Shouldn't this return nil then?

user=> *clojure-version*
{:major 1, :minor 3, :incremental 0, :qualifier "alpha6"}
user=> (.get {1 2} (Integer. 1))
2

Also, if the above is the intended behavior, there are some weird
consequences with the current record equality semantics.  For example,

user=> (defrecord P [])
user.P
user=> (defrecord Q [])
user.Q
user=> (= (P.) (Q.))
false
user=> (.equals (P.) (Q.))
true
user=> {(P.) 1 (Q.) 2}
{#:user.P{} 1, #:user.Q{} 2}
user=> (java.util.HashMap. *1)
#<HashMap {user.P@0=2}>

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