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 EAA12180; Tue, 3 Jul 2001 04:16:39 +0200 (MET DST) 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 EAA12178 for ; Tue, 3 Jul 2001 04:16:38 +0200 (MET DST) Received: from mta05-svc.ntlworld.com (mta05-svc.ntlworld.com [62.253.162.45]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f632Gbb00819 for ; Tue, 3 Jul 2001 04:16:37 +0200 (MET DST) Received: from htec.demon.co.uk ([62.252.168.7]) by mta05-svc.ntlworld.com (InterMail vM.4.01.02.27 201-229-119-110) with ESMTP id <20010703021631.BKFC284.mta05-svc.ntlworld.com@htec.demon.co.uk>; Tue, 3 Jul 2001 03:16:31 +0100 Message-ID: <3B412B82.8243DA9@htec.demon.co.uk> Date: Tue, 03 Jul 2001 03:18:42 +0100 From: Chris Quinn X-Mailer: Mozilla 4.61 [en] (X11; I; Linux 2.4.0-test6 i686) X-Accept-Language: en MIME-Version: 1.0 To: Miles Egan CC: caml-list@inria.fr Subject: Re: [Caml-list] hash_variant anomalies References: <20010702180232.A51837@caddr.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk The Caml runtime makes a basic distinction between memory pointers and everything else - pointers are mod 2 while everything else is shifted along 1 bit and has the lsb set to 1. This allows for operation of the garbage collector. Integers are in the 'everything else' camp so 0 maps to 1, 1 to 3 ...etc. The macros Val_int(x) and Int_val(v) allow for conversion to and from caml integer values and appropriate use of these will correct the apparent anomaly. -- Chris Quinn ------------------- 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