From: Nicolas C. <war...@fr...> - 2004-04-14 17:02:15
|
> Hi, > > I am sometimes missing a function that returns the size of a hash table: > 1. length of the underlying array > 2. number of elements. > > let length tbl = Array.length tbl.data > let size tbl = tbl.size > > The purpose of the length function is to return a good guess for the size > of a table that we want to fill with more or less the same number of > elements than an existing table. > > Did I miss anything? They are actually useful, and I think we could add them to the ExtHashtbl module. However, I'm not sure about the naming : one could mistake size and length. I propose the following : "count" for the number of inserted elements (wrt Enum) "allocated_size" (or something else) for the size of the underlying array. Regards, Nicolas Cannasse |