caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Matthew William Cox <matt@mattcox.ca>
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] equality operators in OCaml
Date: Fri, 25 Jul 2008 16:14:22 -0400	[thread overview]
Message-ID: <20080725201421.GA6015@saturn.mattcox.ca> (raw)
In-Reply-To: <200807242140.40245.peng.zang@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 609 bytes --]

On Thu, Jul 24, 2008 at 09:40:36PM -0400, Peng Zang wrote:
> 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.

It's not broken at all, but complient with a common and longstanding
idiom (at least amoung scientists working with numerical codes.) The way
we test for NaN is by comparing to itself, eg:

    if x = x then (* x is a number *) else (* x is NaN *)

Matt

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

  parent reply	other threads:[~2008-07-25 20:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-24 19:27 Raj Bandyopadhyay
2008-07-24 22:15 ` [Caml-list] " Vincent Hanquez
2008-07-24 22:32 ` Jon Harrop
2008-07-25  1:40   ` Peng Zang
2008-07-25 10:34     ` Christophe TROESTLER
2008-07-25 12:04       ` Peng Zang
2008-07-25 20:14     ` Matthew William Cox [this message]
2008-07-25 22:27       ` Peng Zang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080725201421.GA6015@saturn.mattcox.ca \
    --to=matt@mattcox.ca \
    --cc=caml-list@yquem.inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).