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 BAA26763; Wed, 12 Nov 2003 01:32:48 +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 BAA26960 for ; Wed, 12 Nov 2003 01:32:47 +0100 (MET) Received: from nexus.stwing.upenn.edu (NEXUS.STWING.UPENN.EDU [165.123.132.61]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id hAC0Wk118461 for ; Wed, 12 Nov 2003 01:32:46 +0100 (MET) Received: from force.stwing.upenn.edu (root@force.stwing.upenn.edu [165.123.132.65]) by nexus.stwing.upenn.edu (8.12.10/8.12.9) with ESMTP id hAC0Wi9q004871 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 11 Nov 2003 19:32:44 -0500 (EST) Received: from force.stwing.upenn.edu (wlovas@localhost [127.0.0.1]) by force.stwing.upenn.edu (8.12.10/8.12.9) with ESMTP id hAC0WhWN023845 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 11 Nov 2003 19:32:44 -0500 (EST) Received: (from wlovas@localhost) by force.stwing.upenn.edu (8.12.10/8.12.9/Submit) id hAC0WhfO023844 for caml-list@inria.fr; Tue, 11 Nov 2003 19:32:43 -0500 (EST) Date: Tue, 11 Nov 2003 19:32:43 -0500 From: William Lovas To: caml-list@inria.fr Subject: Re: [Caml-list] Strange physical equality behavior Message-ID: <20031112003242.GA23476@force.stwing.upenn.edu> Mail-Followup-To: caml-list@inria.fr References: <200311091334.13734.oleg_trott@columbia.edu> <20031110103330C.garrigue@kurims.kyoto-u.ac.jp> <200311110148.22096.oleg_trott@columbia.edu> <20031111164656.GA3708@davidb.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031111164656.GA3708@davidb.org> User-Agent: Mutt/1.5.4i X-Loop: caml-list@inria.fr X-Spam: no; 0.00; lovas:01 wlovas:01 stwing:01 caml-list:01 oleg:01 jacques:01 immutable:01 admittedly:01 equality:01 mutable:01 mutable:01 int:01 int:01 garrigue:01 rec:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Tue, Nov 11, 2003 at 08:46:56AM -0800, David Brown wrote: > On Tue, Nov 11, 2003 at 01:48:22AM -0500, Oleg Trott wrote: > > On Sunday 09 November 2003 08:33 pm, Jacques Garrigue wrote: > > > On mutable structures, [e1 == e2] is true if and only if > > > physical modification of [e1] also affects [e2]. > > > > By the way, either "mutable structures" or "physical modification" need > > to be clarified, because if (int ref list) is "mutable" then the above > > is wrong: > > If you take structure to mean a single data type, rather than a more > complicated data structure, then it is true. Well, what do you mean by "a single data type", then? Surely a record is a single data type, but ... type r = { mutable a: int; mutable r: r } let rec r1 = { a = 5; r = r2 } and r2 = { a = 7; r = r1 } Surely you wouldn't argue that this is an immutable data structure, either -- it contains nothing *but* mutable fields! And yet, r1.a <- 6 also "affects" r2, but r1 != r2. (Admittedly, though, the ambiguity may lie in the usage of the word "affects".) *shrug* Maybe it's a bit contrived, but i would err on the side of caution and say that the documentation should be made clearer. William ------------------- 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