Re: int or long as map key

2011-03-30 Thread Stuart Sierra
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

Re: int or long as map key

2011-03-28 Thread Jason Wolfe
> 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

Re: int or long as map key

2011-03-26 Thread Stuart Sierra
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

Re: int or long as map key

2011-03-25 Thread David Nolen
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)

int or long as map key

2011-03-25 Thread daigo
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