Thanks BG.  I recently obtained this knowledge of map implementations 
myself, either on this list or in a book.
 
However, it's the *first* map that has sorted keys!  That's the opposite of 
what we'd expect from your explanation, because the large map appears 
sorted while the small map is unsorted.
 

On Monday, September 30, 2013 8:36:45 PM UTC+10, Baishampayan Ghose wrote:

> The second one is actually a PersistentArrayMap and hence properties 
> that might indicate (falsely) that it's a sorted-map (aka 
> PersistentTreeMap). Clojure uses PersistentArrayMap for small maps as 
> an optimisation and automatically promotes to PersistentHashMap when 
> the number of items crosses a certain threshold (32, IIRC). 
>
> Regards, 
> BG 
>
>

-- 
-- 
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/groups/opt_out.

Reply via email to