caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* modifying hash tables
@ 2007-07-18 15:27 Sam Steingold
  2007-07-18 16:00 ` [Caml-list] " Christopher L Conway
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Sam Steingold @ 2007-07-18 15:27 UTC (permalink / raw)
  To: caml-list

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I want to modify the _current_ datum in Hashtable.iter, e.g., increment
a count. Is this code valid?
Hashtable.iter ht ~f:(fun ~key ~data ->
  Hashtable.replace ht ~key ~data:(data+1))
(it appears to work, but I was told that "it is not guaranteed to work",
i.e., the documentation does not promise that).
If the above code is wrong, what is TRT?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGnjFxPp1Qsf2qnMcRAhFaAJ0WEo90RwF5e1Ue+0tCdLyW2R5gawCcCJfd
T8szhrihvlLwCh5L+er0N1E=
=9bhb
-----END PGP SIGNATURE-----


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

end of thread, other threads:[~2007-07-18 20:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-18 15:27 modifying hash tables Sam Steingold
2007-07-18 16:00 ` [Caml-list] " Christopher L Conway
2007-07-18 16:01 ` Sam Steingold
2007-07-18 16:36   ` [Caml-list] " Brian Hurt
2007-07-18 16:08 ` [Caml-list] " David Allsopp
2007-07-18 16:38 ` Zheng Li
2007-07-18 20:38 ` [Caml-list] " Jon Harrop

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