From: Alain Frisch <alain@frisch.fr>
To: ivan chollet <ivan.chollet@free.fr>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Re: ocaml sefault in bytecode: unanswered questions
Date: Sun, 09 Aug 2009 15:55:07 +0200 [thread overview]
Message-ID: <4A7ED53B.90607@frisch.fr> (raw)
In-Reply-To: <001201ca18e9$c4456810$4cd03830$@chollet@free.fr>
On 8/9/2009 2:06 PM, ivan chollet wrote:
> I would have thought physical equality implies structural equality, but
> it doesn’t seem like it.
>
> Can you please explain to me what’s wrong there?
There are two modes for the generic comparison. The total mode
(Pervasives.compare) creates a total ordering between values (except for
functional values and custom blocks with no comparison function) and
uses physical equality as a shortcut to cut the recursive traversal of
sub-values. The non-total mode (used by the operators = < > <= >=) has a
different behavior for NaN values ([nan <= x], [x <= nan], and [nan = x]
all return false, including when x is nan) and does not use the physical
equality shortcut (so that [let x = (nan, nan) in x = x] returns false).
-- Alain
next prev parent reply other threads:[~2009-08-09 13:55 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-08 17:09 ivan chollet
2009-08-08 17:24 ` [Caml-list] " David Allsopp
2009-08-09 7:58 ` ivan chollet
2009-08-09 10:16 ` Michel Mauny
[not found] ` <001501ca18cc$d59a61a0$80cf24e0$@metastack.com>
2009-08-09 12:06 ` ivan chollet
2009-08-09 13:20 ` David Allsopp
2009-08-09 13:55 ` Alain Frisch [this message]
2009-08-09 14:13 ` ivan chollet
2009-08-09 18:56 ` Elnatan Reisner
2009-08-09 19:09 ` Alain Frisch
2009-08-10 13:22 ` Elnatan Reisner
2009-08-10 13:36 ` Martin Jambon
2009-08-10 14:26 ` Elnatan Reisner
2009-08-09 16:14 ` Goswin von Brederlow
2009-08-10 4:14 ` ivan chollet
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=4A7ED53B.90607@frisch.fr \
--to=alain@frisch.fr \
--cc=caml-list@yquem.inria.fr \
--cc=ivan.chollet@free.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