caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Should be INSIDE STANDARD-LIB: Hashtbl.keys
@ 2004-04-21  1:19 Oliver Bandel
  2004-04-21  8:39 ` Richard Jones
                   ` (3 more replies)
  0 siblings, 4 replies; 25+ messages in thread
From: Oliver Bandel @ 2004-04-21  1:19 UTC (permalink / raw)
  To: caml-list

Hi,

I think a good addition to the Hashtbl-module
would be a function, that gives back a list of keys
that are in the hash.

Well, ok, I've written code for doing this task,
before I've mailed this idea to the list,
so I'm not looking for code / for help with sources here.


I only think, this is such an often used function, that
it should be integrated into the Hastbl-module.

Well, should be something like this one:


           val keys : ('a, 'b) t -> 'a list

  usage:
      Hashtbl.keys <hash>  returns a list of all keys of the
      hash "hash", that exists and therefore have values bound
      to it. If a key has several bindings, it will occur only
      once in this list.
   

IMHO it should be possible to implement a Hashtbl.keys function
inside the Hashtbl-module-sources much more efficient than
doing it via the already given Hashtbl-functions of that module,
that are exported.

But even if this would not be true, I think, giving back a list of
all keys in a hash (with each key reported only once, even if it has
more than one binding) is a rudimentary and necessary function,
that should be integrated in the standard-Hashtbl-Lib-module.

Best regards to all OCaml core developers (and all other readers too) here.

Ciao,
   Oliver Bandel

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


^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~2004-04-26  7:49 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-21  1:19 [Caml-list] Should be INSIDE STANDARD-LIB: Hashtbl.keys Oliver Bandel
2004-04-21  8:39 ` Richard Jones
2004-04-21  9:13 ` Martin Jambon
2004-04-23 12:51 ` Xavier Leroy
2004-04-23 13:05   ` Jean-Baptiste Rouquier
2004-04-23 16:04     ` Xavier Leroy
2004-04-23 18:21       ` Jon Harrop
2004-04-23 21:31         ` Jon Harrop
2004-04-23 21:53           ` John Goerzen
2004-04-26  6:28           ` Florian Hars
2004-04-23 18:29       ` John Goerzen
     [not found]         ` <20040423190710.GA1506@first.in-berlin.de>
2004-04-23 20:42           ` John Goerzen
2004-04-23 15:03   ` Richard Jones
2004-04-24  1:58     ` skaller
2004-04-24  9:20       ` Nicolas Cannasse
2004-04-24 19:26         ` skaller
2004-04-26  7:29       ` Jean-Christophe Filliatre
2004-04-23 16:06   ` Brian Hurt
2004-04-23 16:31     ` Martin Jambon
2004-04-23 17:27     ` Christoph Bauer
2004-04-23 18:29   ` John Goerzen
     [not found]     ` <20040423191010.GB1506@first.in-berlin.de>
2004-04-23 20:41       ` John Goerzen
     [not found]         ` <20040424080904.GA821@first.in-berlin.de>
2004-04-24 20:59           ` John Goerzen
2004-04-25  8:12             ` Oliver Bandel
2004-04-23 18:28 ` John Goerzen

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