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 LAA27802; Tue, 29 Oct 2002 11:32:05 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 LAA27903 for ; Tue, 29 Oct 2002 11:32:05 +0100 (MET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g9TAW3515548; Tue, 29 Oct 2002 11:32:03 +0100 (MET) Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id LAA27077; Tue, 29 Oct 2002 11:32:02 +0100 (MET) From: Pierre Weis Message-Id: <200210291032.LAA27077@pauillac.inria.fr> Subject: Re: [Caml-list] On the equality of functional values In-Reply-To: <3DBCD600.2000307@baretta.com> from Alessandro Baretta at "Oct 28, 102 07:15:28 am" To: alex@baretta.com (Alessandro Baretta) Date: Tue, 29 Oct 2002 11:32:02 +0100 (MET) Cc: caml-list@inria.fr X-Mailer: ELM [version 2.4ME+ PL28 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > 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