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: skaller <skaller@u...>
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.

-- 
John Skaller, mailto:skaller@users.sf.net
voice: 061-2-9660-0850, 
snail: PO BOX 401 Glebe NSW 2037 Australia
Checkout the Felix programming language http://felix.sf.net



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