caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Pierre Weis <pierre.weis@inria.fr>
To: alex@baretta.com (Alessandro Baretta)
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] On the equality of functional values
Date: Tue, 29 Oct 2002 11:32:02 +0100 (MET)	[thread overview]
Message-ID: <200210291032.LAA27077@pauillac.inria.fr> (raw)
In-Reply-To: <3DBCD600.2000307@baretta.com> from Alessandro Baretta at "Oct 28, 102 07:15:28 am"

> David Monniaux wrote:
> > On Sun, 27 Oct 2002, Alessandro Baretta wrote:
> > 
> > 
> > If I remember well, = is implemented by doing first a == (equality of
> > pointers) test, and returning true if that test succeeds; otherwise,
> > the more complex recursive equality test is performed, which fails with
> > an exception if it encounters functional values.
> > 
> > So if x and y are the same closure, x=y succeeds and yields the true
> > value. Otherwise, it throws an exception.
> 
> This is what I suspected. I wonder if this behavior conforms 
> to specification, or if it is an incidental concequence of 
> the implementation of (=).
> 
> Alex

This is in the spec of = and ==.

This is explained in large in the FAQ:

-- What's the difference between = and == ?
   http://pauillac.inria.fr/caml/FAQ/FAQ_EXPERT-eng.html#egalite
-- How to compare functional values ?
   (Invalid_argument "equal: functional value") ?
   http://pauillac.inria.fr/caml/FAQ/FAQ_EXPERT-eng.html#egalitefonctionnelle

Best regards,

Pierre Weis

INRIA, Projet Cristal, Pierre.Weis@inria.fr, http://pauillac.inria.fr/~weis/


-------------------
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


  parent reply	other threads:[~2002-10-29 10:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-27 14:10 Alessandro Baretta
2002-10-27 15:34 ` David Brown
2002-10-27 17:58 ` David Monniaux
2002-10-28  6:15   ` Alessandro Baretta
2002-10-28  8:34     ` jeanmarc.eber
2002-10-29 10:32     ` Pierre Weis [this message]
2002-10-27 18:02 ` Remi VANICAT

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=200210291032.LAA27077@pauillac.inria.fr \
    --to=pierre.weis@inria.fr \
    --cc=alex@baretta.com \
    --cc=caml-list@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).