Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
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.)

Ciao,
   Oliver

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners