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 GAA15921; Fri, 19 Oct 2001 06:20:23 +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 GAA15920 for ; Fri, 19 Oct 2001 06:20:22 +0200 (MET DST) Received: from hotmail.com (f218.law15.hotmail.com [64.4.23.218]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f9J4KLn13535 for ; Fri, 19 Oct 2001 06:20:21 +0200 (MET DST) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Thu, 18 Oct 2001 21:20:20 -0700 Received: from 164.107.100.139 by lw15fd.law15.hotmail.msn.com with HTTP; Fri, 19 Oct 2001 04:20:19 GMT X-Originating-IP: [164.107.100.139] From: "Jeremy Fincher" To: caml-list@pauillac.inria.fr Subject: [Caml-list] Possible function to add to Hashtbl? Date: Fri, 19 Oct 2001 00:20:19 -0400 Mime-Version: 1.0 Content-Type: text/plain; format=flowed Message-ID: X-OriginalArrivalTime: 19 Oct 2001 04:20:20.0026 (UTC) FILETIME=[5D15D1A0:01C15855] Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On the rare occasions I do find myself using the using multiple bindings of a single key in a hashtbl, I also find myself needing a "remove_all" function, which removes all the bindings to a particular key in a hashtbl. Perhaps such a function should be added to the module? I'm sure there's a more efficient way to implement such a function in the hashtbl module, but here's what I've been using thus far: ----- let hashtbl_remove_all h key = for i=1 to List.length (Hashtbl.find_all h key) do Hashtbl.remove h key; done ----- Jeremy _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr