caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Jeremy Fincher" <tweedgeezer@hotmail.com>
To: caml-list@pauillac.inria.fr
Subject: [Caml-list] Possible function to add to Hashtbl?
Date: Fri, 19 Oct 2001 00:20:19 -0400	[thread overview]
Message-ID: <F218UXPdvgyf2M0KFHR0000c8f2@hotmail.com> (raw)

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


             reply	other threads:[~2001-10-19  4:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-19  4:20 Jeremy Fincher [this message]
2001-10-19 12:41 ` Jean-Christophe Filliatre

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=F218UXPdvgyf2M0KFHR0000c8f2@hotmail.com \
    --to=tweedgeezer@hotmail.com \
    --cc=caml-list@pauillac.inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).