From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.7 required=5.0 tests=AWL,DNS_FROM_RFC_POST, SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id 3F349BBAF for ; Fri, 25 Jul 2008 03:40:45 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApwAAEjMiEhC+VLilGdsb2JhbACSEUMBAQEBCQMKBxEDmHKGBQ X-IronPort-AV: E=Sophos;i="4.31,249,1215381600"; d="scan'208";a="13433081" Received: from wx-out-0506.google.com ([66.249.82.226]) by mail2-smtp-roc.national.inria.fr with ESMTP; 25 Jul 2008 03:40:44 +0200 Received: by wx-out-0506.google.com with SMTP id i30so2012011wxd.15 for ; Thu, 24 Jul 2008 18:40:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:reply-to:to:subject:date :user-agent:cc:references:in-reply-to:content-type :content-transfer-encoding:content-disposition:message-id; bh=Gy/3nOLCPyhgFQb5FQoLOEovc3i/p9xIi5nLRQr9e1I=; b=dJodge1vG6u67xRrs9JxjNfWm2l4jo3rKB2Kl4N//FRmxr0vEpnwyZDYzxKo79j0ew k+khPfgVt9SwPApnlpegWpcYA/mFiJ9dY10n8JsuFDlYVkoLWZHGnVDqieoFpqzSqag1 9U1w58vQDqcN0c01+En2UOJTUqw2eB8RGvrqo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:reply-to:to:subject:date:user-agent:cc:references:in-reply-to :content-type:content-transfer-encoding:content-disposition :message-id; b=gwAQa/EYTm59oj2req+/Yef8G/3pTRhXKfNLH+VP6AUJCglZZ4Priozsxq5f3qEhOA rcYlXG3fe/4xQSJ5lnsSiulQBBe6/2kxf3AlPa9DeCS/SipKM82k2xlc1emaZq3cpzra nWz0YDWP18onfgQwpc9lkP+Uaqleh6N6WSe0U= Received: by 10.70.113.5 with SMTP id l5mr1118081wxc.69.1216950043284; Thu, 24 Jul 2008 18:40:43 -0700 (PDT) Received: from ?192.168.0.102? ( [24.99.180.210]) by mx.google.com with ESMTPS id b45sm6903805hsa.6.2008.07.24.18.40.41 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 24 Jul 2008 18:40:42 -0700 (PDT) From: Peng Zang Reply-To: peng.zang@gmail.com To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] equality operators in OCaml Date: Thu, 24 Jul 2008 21:40:36 -0400 User-Agent: KMail/1.9.7 Cc: "Jon Harrop" , "Raj Bandyopadhyay" References: <4888D7B7.8030703@rice.edu> <732669E74A7B4E49A8F225F86C335C5E@frodo> In-Reply-To: <732669E74A7B4E49A8F225F86C335C5E@frodo> Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200807242140.40245.peng.zang@gmail.com> X-Spam: no; 0.00; ocaml:01 hash:01 ocaml:01 pointer:01 structurally:01 structurally:01 redefined:01 peng:98 peng:98 equality:01 equality:01 wrote:01 caml-list:01 gnu:03 fix:05 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thursday 24 July 2008 06:32:36 pm Jon Harrop wrote: > From: "Raj Bandyopadhyay" > > > Hi OCaml folk > > > > I apologize if I've been asking too many questions on this list recently, > > but I'm working on a heavy OCaml application and need help sometimes. > > > > I am having a disagreement with a colleague about how the equality > > operators in OCaml work and am trying to resolve it conclusively. > > > > 1) I understand that the '==' operator is basically a pointer comparison > > i.e. a==b true iff a and b are the same entity. Is this true? > > There are some complications here. Firstly, NaN has multiple > representations that may or may not be physically equal but is always > structurally unequal to itself. Yeah, that always seemed broken to me. If two things are physically equal (they occupy the same memory space) it doesn't make sense for them to be structurally unequal (contain different content). Personally, one of the first things I did is redefined (=) to fix this. Peng -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (GNU/Linux) iD8DBQFIiS8YfIRcEFL/JewRAnXqAKCAhHWGTHe6z58jRplmMmnNFgljUACfUhaJ SQSWrxxpPpHqiJcFBcNlVsM= =af4P -----END PGP SIGNATURE-----