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 RAA18942; Fri, 23 Aug 2002 17:27:47 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 RAA19876 for ; Fri, 23 Aug 2002 17:27:46 +0200 (MET DST) Received: from mailhost.tni.fr (firewall.tni.fr [195.25.255.61]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g7NFRjD16969 for ; Fri, 23 Aug 2002 17:27:45 +0200 (MET DST) Received: from groscool.tni.fr ([195.25.255.1]) by mailhost.tni.fr (Netscape Messaging Server 3.62) with SMTP id 5530 for ; Fri, 23 Aug 2002 17:26:55 +0200 Received: from 192.168.7.72 by groscool.tni.fr (InterScan E-Mail VirusWall NT); Fri, 23 Aug 2002 17:26:55 +0200 (Paris, Madrid (heure d'été)) Message-ID: <3D6653C0.F895EC59@tni.fr> Date: Fri, 23 Aug 2002 17:24:48 +0200 From: "sebastien FURIC" X-Mailer: Mozilla 4.7 [fr] (WinNT; I) X-Accept-Language: fr MIME-Version: 1.0 To: OCaml Mailing list Subject: [Caml-list] Hashtbl.hash and Hashtbl.hash_param Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk What kind of algorithm is used to compute the hash code of objects in O'Caml ? Hashtbl.hash (List.map (fun x -> Random.int 100) [1;2;3;4;5;6;7;8;9;10]);; always returns 0 (Hashtbl.hash_param has the same properties) which is a poor result ! What can I do if I don't know the size of the list in advance ? Cheers, Sebastien. ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners