From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id LAA01639; Mon, 26 Nov 2001 11:13:13 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id LAA01702 for ; Mon, 26 Nov 2001 11:13:12 +0100 (MET) Received: from ionie.inria.fr (ionie.inria.fr [128.93.39.12]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id fAQADB110959; Mon, 26 Nov 2001 11:13:11 +0100 (MET) Received: from ionie.inria.fr (localhost [127.0.0.1]) by ionie.inria.fr (8.11.1/8.11.1) with ESMTP id fAQADBH09822; Mon, 26 Nov 2001 11:13:11 +0100 (MET) Message-Id: <200111261013.fAQADBH09822@ionie.inria.fr> X-Mailer: exmh version 2.1.1 10/15/1999 To: caml-list@inria.fr Cc: Francois.Thomasset@inria.fr (Francois Thomasset) Subject: [Caml-list] Use of Hashtbl Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Date: Mon, 26 Nov 2001 11:13:11 +0100 From: Francois Thomasset Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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