Hi,

On 17 Dez., 14:55, MikeM <michael.messini...@invista.com> wrote:
> ((sorted-map 'a 1 'b 2) "a") => ClassCastException
>
> I would think that sorted-maps and hash-maps should both give nil for
> this, but perhaps the sorted-map implementation requires a cast?

Obviously a string is not a symbol. A sorted-map only
makes sense with comparable keys. How do you compare
a string and a symbol for sorting? And indeed:

((sorted-map 'a 1 'b 2) 'c) => nil

I think, that this is a bug - not in sorted-map, but in the user
code providing a wrong (type of) key.

Sincerely
Meikel


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