Hi,

On Tuesday, September 13, 2011 6:28:01 AM UTC+2, Ken Wesson wrote:
>
>
> They're trees of arrays of 32 items, and the trees can in principle
> have arbitrary depth. So the 2^31 limit on Java arrays doesn't impact
> the Clojure collections, it seems.
>

are you sure?  As far as I understood things (reading PersistentVector.java 
and [1]), there can only be 6 levels of nodes, because of the 32bit which 
are used to store an integer and because of the bit-shifting which is used 
to find the correct level. 
That would lead to a limit of 32^6 which is half of the 2^31:

user=> (= (Math/pow 2 31) (* 2 (Math/pow 32 6)))
true

:-)

Regards,
Stefan

[1] 
http://blog.higher-order.net/2009/02/01/understanding-clojures-persistentvector-implementation/

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

Reply via email to