From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id DAA27864; Sat, 24 Apr 2004 03:59:05 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id DAA27850 for ; Sat, 24 Apr 2004 03:59:04 +0200 (MET DST) Received: from smtp3.adl2.internode.on.net (smtp3.adl2.internode.on.net [203.16.214.203]) by nez-perce.inria.fr (8.12.10/8.12.10) with ESMTP id i3O1x0jq022488 for ; Sat, 24 Apr 2004 03:59:02 +0200 Received: from [192.168.1.200] (ppp119-113.lns1.syd2.internode.on.net [150.101.119.113]) by smtp3.adl2.internode.on.net (8.12.9/8.12.9) with ESMTP id i3O1wrk2058363; Sat, 24 Apr 2004 11:28:54 +0930 (CST) Subject: Re: [Caml-list] Should be INSIDE STANDARD-LIB: Hashtbl.keys From: skaller Reply-To: skaller@users.sourceforge.net To: Richard Jones Cc: caml-list In-Reply-To: <20040423150322.GA21489@redhat.com> References: <20040421011904.GA1411@first.in-berlin.de> <20040423145141.B3686@pauillac.inria.fr> <20040423150322.GA21489@redhat.com> Content-Type: text/plain Message-Id: <1082771932.21205.654.camel@pelican.wigram> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) Date: 24 Apr 2004 11:58:52 +1000 Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 hashtbl:01 sourceforge:01 2004:99 hashtbl:01 hash:01 implemented:01 9660:01 glebe:01 arrays:01 arrays:01 bindings:01 ocaml:01 ocaml:01 mutable:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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