From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id D7916BB81 for ; Wed, 12 Oct 2005 09:42:00 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j9C7g0m0023454 for ; Wed, 12 Oct 2005 09:42:00 +0200 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id JAA27103 for ; Wed, 12 Oct 2005 09:41:59 +0200 (MET DST) Received: from mail.tcs.inf.tu-dresden.de (tcs01.inf.tu-dresden.de [141.76.75.1]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j9C7fxho023451 for ; Wed, 12 Oct 2005 09:41:59 +0200 Received: from localhost (localhost [127.0.0.1]) by mail.tcs.inf.tu-dresden.de (Sun Java System Messaging Server 6.1 HotFix 0.06 (built Nov 11 2004)) with ESMTP id <0IO800A1YLDZ5Y00@mail.tcs.inf.tu-dresden.de> for caml-list@inria.fr; Wed, 12 Oct 2005 09:41:59 +0200 (MEST) Received: from tcs01.inf.tu-dresden.de ([127.0.0.1]) by localhost (mail.tcs.inf.tu-dresden.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 13789-06 for ; Wed, 12 Oct 2005 09:41:59 +0200 (MEST) Received: from ithif59.inf.tu-dresden.de (ithif59.inf.tu-dresden.de [141.76.75.59]) by mail.tcs.inf.tu-dresden.de (Sun Java System Messaging Server 6.1 HotFix 0.06 (built Nov 11 2004)) with ESMTPS id <0IO800A1KLDZAI00@mail.tcs.inf.tu-dresden.de> for caml-list@inria.fr; Wed, 12 Oct 2005 09:41:59 +0200 (MEST) Received: from tews by ithif59.inf.tu-dresden.de with local (Exim 4.50) id 1EPbFP-00017l-8R for caml-list@inria.fr; Wed, 12 Oct 2005 09:41:59 +0200 Date: Wed, 12 Oct 2005 09:41:58 +0200 From: Hendrik Tews Subject: Re: [Caml-list] EQ hash tables? In-reply-to: To: Caml List Message-id: MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7BIT X-Virus-Scanned: amavisd-new at tcs.inf.tu-dresden.de References: <14893115.1128951765427.JavaMail.www@wwinf1521> User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 X-Miltered: at nez-perce with ID 434CBE48.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 434CBE47.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; hendrik:01 tews:01 tews:01 caml-list:01 hash:01 ocaml:01 hash:01 hendrik:01 equality:01 writes:01 tu-dresden:01 data:02 data:02 match:02 tcs:02 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 Thomas Fischbacher writes: Actually, this brings me to a question I wanted to ask for a long time: while I never used this so far, I just assumed that OCaml does provide hash tables where keys are compared w.r.t. "being the same" ('==' , that is), rather than only hash tables where keys are compared for "being equal" (say, '='). Just look at hash.ml: let find h key = match h.data.((hash key) mod (Array.length h.data)) with Empty -> raise Not_found | Cons(k1, d1, rest1) -> if compare key k1 = 0 then d1 else ^^^^^^^^^^^^^^^^^^ So it's structual equality, which is the same as '=' modulo the float nan issue. Bye, Hendrik