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 SAA13296; Sun, 27 Oct 2002 18:58:43 +0100 (MET) 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 SAA07543 for ; Sun, 27 Oct 2002 18:58:42 +0100 (MET) Received: from nef.ens.fr (nef.ens.fr [129.199.96.32]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g9RHwf529189 for ; Sun, 27 Oct 2002 18:58:41 +0100 (MET) Received: from dmi.ens.fr (dmi.ens.fr [129.199.96.11]) by nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id g9RHweB35028 ; Sun, 27 Oct 2002 18:58:40 +0100 (CET) Received: from basilic.ens.fr (monniaux@basilic [129.199.99.48]) by dmi.ens.fr (8.10.1/jb-1.3-180200) id g9RHwdh07495 ; Sun, 27 Oct 2002 18:58:39 +0100 (MET) Received: from localhost (monniaux@localhost) by basilic.ens.fr (8.11.0/jb-1.1) id g9RHwcV08997 ; Sun, 27 Oct 2002 18:58:38 +0100 (MET) X-Authentication-Warning: basilic.ens.fr: monniaux owned process doing -bs Date: Sun, 27 Oct 2002 18:58:38 +0100 (MET) From: David Monniaux X-Sender: monniaux@basilic.ens.fr To: Alessandro Baretta cc: Ocaml Subject: Re: [Caml-list] On the equality of functional values In-Reply-To: <3DBBF3F3.8080600@baretta.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Sun, 27 Oct 2002, Alessandro Baretta wrote: > I typed does not raise the same exception. This seems to > imply that comparisons are allowed between functional > values, too. 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. David Monniaux http://www.di.ens.fr/~monniaux Laboratoire d'informatique de l'École Normale Supérieure, Paris, France ------------------- 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