caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Hashtbl: get first n keys
@ 2007-12-11  8:57 tmp123
  2007-12-11 15:40 ` [Caml-list] " Fabrice Marchant
  2007-12-11 15:42 ` Fabrice Marchant
  0 siblings, 2 replies; 3+ messages in thread
From: tmp123 @ 2007-12-11  8:57 UTC (permalink / raw)
  To: caml-list

Hello,

Please, could someone suggest a way to get "n" keys of a hash table? No 
order nor other restriction about the keys, just "n " keys existing in 
the table.

A method based on "iter" and raise and exception when limit is reached 
seems possible, but could be there are better options.

Thanks a lot.


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

* Re: [Caml-list] Hashtbl: get first n keys
  2007-12-11  8:57 Hashtbl: get first n keys tmp123
@ 2007-12-11 15:40 ` Fabrice Marchant
  2007-12-11 15:42 ` Fabrice Marchant
  1 sibling, 0 replies; 3+ messages in thread
From: Fabrice Marchant @ 2007-12-11 15:40 UTC (permalink / raw)
  To: caml-list

> Please, could someone suggest a way to get "n" keys of a hash table? No 
> order nor other restriction about the keys, just "n " keys existing in 
> the table.
> 
> A method based on "iter" and raise and exception when limit is reached 
> seems possible, but could be there are better options.

  Hi !

A particular case - n = 1 - , for a hashSet that lacked a function to exhibit one some element :

http://tech.groups.yahoo.com/group/ocaml_beginners/message/8088

Based on the iter / exception however.

Should be easy to adapt this to your problem.

Regards,

Fabrice


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

* Re: [Caml-list] Hashtbl: get first n keys
  2007-12-11  8:57 Hashtbl: get first n keys tmp123
  2007-12-11 15:40 ` [Caml-list] " Fabrice Marchant
@ 2007-12-11 15:42 ` Fabrice Marchant
  1 sibling, 0 replies; 3+ messages in thread
From: Fabrice Marchant @ 2007-12-11 15:42 UTC (permalink / raw)
  To: caml-list

> Please, could someone suggest a way to get "n" keys of a hash table? No 
> order nor other restriction about the keys, just "n " keys existing in 
> the table.
> 
> A method based on "iter" and raise and exception when limit is reached 
> seems possible, but could be there are better options.

  Hi !

A particular case - n = 1 - , for a hashSet that lacked a function to exhibit one some element :

http://tech.groups.yahoo.com/group/ocaml_beginners/message/8088

However based on the iter / exception you spoke about.

Should be easy to adapt this to your problem.

Regards,

Fabrice


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

end of thread, other threads:[~2007-12-11 16:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-11  8:57 Hashtbl: get first n keys tmp123
2007-12-11 15:40 ` [Caml-list] " Fabrice Marchant
2007-12-11 15:42 ` Fabrice Marchant

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