Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Possible function to add to Hashtbl?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jeremy Fincher <tweedgeezer@h...>
Subject: [Caml-list] Possible function to add to Hashtbl?
On the rare occasions I do find myself using the using multiple bindings of 
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;


Get your FREE download of MSN Explorer at

Bug reports:  FAQ:
To unsubscribe, mail  Archives: