Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[oliver: Re: [Caml-list] Should be INSIDE STANDARD-LIB: Hashtbl.keys]
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-04-24 (11:00)
From: oliver@f...
Subject: Re: [oliver: Re: [Caml-list] Should be INSIDE STANDARD-LIB: Hashtbl.keys]
On Sat, Apr 24, 2004 at 05:46:17AM +0100, Jon Harrop wrote:
> On Saturday 24 April 2004 4:00 am, skaller wrote:
> > On Sat, 2004-04-24 at 06:09, Oliver Bandel wrote:
> > > Because there is no Hashtbl.size in the standard lib,
> >
> > which sux because O(n) is a high price to pay
> > for an integer the Hashtbl could keep track of
> > easily.
> I don't want the overhead of hash tables carrying around and updating an int. 
> I was miffed when they put an O(1) criterion on length() in the STL "list" in 
> C++...

OK, if it is too much performance critical, then forget the idea with
the counter.

So Hashtbl.size should be done with Hashtbl.iter and incrementing
a counter-ref then.

But maybe it nevertheless makes sense to put it inside the
Hashtbl-module. (But not necissarily.)


To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: