caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Francois Thomasset <francois.thomasset@inria.fr>
To: caml-list@inria.fr
Cc: Francois.Thomasset@inria.fr (Francois Thomasset)
Subject: [Caml-list] Use of Hashtbl
Date: Mon, 26 Nov 2001 11:13:11 +0100	[thread overview]
Message-ID: <200111261013.fAQADBH09822@ionie.inria.fr> (raw)

Hi
I can't explain the following behavior of add in module Hashtbl.
What I would like to have is an implementation of a set of strings: insertion, 
test for membership, print funtion of the set. I know I could use the Set 
module, but I don't really need to be applicative. Anyway I wonder what's 
wrong with the code below.

module T = Hashtbl ;;
let hashtable : (string,unit) T.t = T.create 128 ;;
# T.add hashtable "un" ();;
- : unit = ()
# T.add hashtable "deux" ();;
- : unit = ()
# T.mem hashtable "un";;  
- : bool = true
# T.mem hashtable "deux";;   
- : bool = true
# T.clear hashtable;;
- : unit = ()

Fine. Now I add my strings all in one shot:
# T.add hashtable "un" ();; T.add hashtable "deux" ();;
- : unit = ()
# T.mem hashtable "un";;  
- : bool = true
# T.mem hashtable "deux";;   
- : bool = false
I must have missed something... Where is "deux"?

					François Thomasset.
					INRIA (A3)

Tel: +33 (1) 39-63-54-75
Fax: +33 (1) 39-63-53-30 ou +33 (1) 39-63-59-95
Email: Francois.Thomasset@inria.fr
Smail: INRIA, Rocquencourt, BP 105, 78153 Le Chesnay Cedex, France


-------------------
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-11-26 10:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-26 10:13 Francois Thomasset [this message]
2001-11-26 10:34 ` Nicolas George
2001-11-26 10:20 Damien Doligez

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=200111261013.fAQADBH09822@ionie.inria.fr \
    --to=francois.thomasset@inria.fr \
    --cc=caml-list@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).