chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] #:size argument to make-hash-table


From: Kon Lovett
Subject: Re: [Chicken-users] #:size argument to make-hash-table
Date: Fri, 14 May 2010 13:43:44 -0700


On May 14, 2010, at 1:08 PM, Jeronimo Pellegrini wrote:

Hi,

I'm not sure I understand how the #:size argument to make-hash-table
works.

#;18> (define a (make-hash-table #:size 100000 #:min-load 0.2 ))
#;19> (vector-length (##sys#slot a 1)) ;; interal vector
307
#;20> (##sys#slot a 5)
0.2
#;21> (hash-table-min-load a)

So, it seems that I could set the min-load of the hashtable, but
setting the size doesn't seem to do anyhing, as it will always
be 307 (the smallest size that Chicken uses for the internal vector).

Is the internal vector size not immediately created with some value in
hash-table-prime-lengths [0] that is close to the expected size? Or
is the #:size parameter used in some other way?

The #:size handling is broken. The ref 'hash-table-max-size' should be 'hash-table-max-length'. I think this is fixed in an "experimental" set but not in a release.

But, aside from the above problem, it does chose an actual length in a manner you surmised.


Thanks
J.

[0] In srfi-69.scm


_______________________________________________
Chicken-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/chicken-users

Best Wishes,
Kon





reply via email to

[Prev in Thread] Current Thread [Next in Thread]