Version française
Home     About     Download     Resources     Contact us    
Browse thread
[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: Nicolas Cannasse <warplayer@f...>
Subject: Re: [Caml-list] Should be INSIDE STANDARD-LIB: Hashtbl.keys
> On Sat, 2004-04-24 at 01:03, Richard Jones wrote:
> > Maybe there's no good behaviour, but I keep writing a 'keys' function
> > in almost every program I've written which uses Hashtbl, which
> > certainly suggests that something is missing.
>
> The problem is that the Ocaml hashtbl isn't a conventional
> hash table. It allows multiple bindings which means it
> cannot be treated as a simple container.
>
> I spend some time making sure I don't use that
> feature by mistake.
>
> Similar 'too rich' functionality exists for
> many data types, for example mutable strings and arrays.
> On the other hand some functionality is missing,
> for example variable length arrays.
>
> The former can be fixed easily by the client
> building a wrapper library with restricted functionality.
>
> The latter *needs* to be added to the standard
> library urgently because it cannot be implemented
> at all in Ocaml without magic, and it is a very
> useful and important data structure to have.

You can have a look at the nice DynArray module from the ExtLib :
http://ocaml-lib.sf.net

Regards,
Nicolas Cannasse

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