Keys in a map that are of type long can't be looked up in a map using
int literal syntax:

user=> (def my_map { (java.lang.Long. "42") "foo"})
#'user/my_map

user=> my_map
{42 "foo"}

user=> (my_map 42)
nil

user=> (my_map (long 42))
"foo"

user=> (= 42 (java.lang.Long. "42"))
true

I found this behavior incredibly confusing, especially given the fact
that ints and longs print the same.

I believe this is a bug. Rich, do you agree?

Allen

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