Looks like that bit is not finished yet. See
http://dev.clojure.org/display/doc/Enhanced+Primitive+Support under "hash
maps and sets now use = for keys"
-S
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojur
> 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 beha
Through version 1.2.0, Clojure used Java's Object.equals method for map
lookups. Java specifies Object.equals to be false for numbers of different
types.
Clojure 1.3.0-alpha* uses its own = function for map lookups specifically to
avoid this problem. The = function is true for numbers of diff
On Fri, Mar 25, 2011 at 9:18 PM, daigo wrote:
> I have just started learning Clojure.
> Thank you for developing a wonderful language.
>
> Is this behavior by design?
> If so, how can I loosely use numerical values as keys?
>
> Clojure 1.2.0
> user=> (def m {1 10 2 20})
> #'user/m
> user=> (m 2)
I have just started learning Clojure.
Thank you for developing a wonderful language.
Is this behavior by design?
If so, how can I loosely use numerical values as keys?
Clojure 1.2.0
user=> (def m {1 10 2 20})
#'user/m
user=> (m 2)
20
user=> (m (long 2))
nil
Regards,
Daigo
--
You received this