Sorted maps are maps but they have an additional constraint that the keys 
must be comparable according to the map's comparator.

Clojure intentionally does not define a total sort order crossing types 
(there is no such ordering that makes sense).

You are however free to define your own comparator that does whatever you 
want (including defining comparisons across keywords and strings or 
whatever) by supplying it to sorted-map when you construct it. You can find 
a lot more about comparators at http://clojure.org/guides/comparators .

Alex


On Thursday, April 28, 2016 at 4:32:15 PM UTC-5, JPatrick Davenport wrote:
>
> Thank you for the response. Isn't that a leaky abstraction? Now all 
> clients of rename-keys would have to care what the key type is. At the very 
> least both should implement Comparable and have some kind of general 
> response for sorting. 

-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to