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 AAA27261; Sat, 28 Feb 2004 00:17:46 +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 AAA25578 for ; Sat, 28 Feb 2004 00:17:44 +0100 (MET) Received: from moby.atcorp.com (moby.atcorp.com [204.72.172.2]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i1RNHhae021947 for ; Sat, 28 Feb 2004 00:17:43 +0100 Received: from SAILFISH (conger.atcorp.com [204.72.172.102]) by moby.atcorp.com (8.11.6/8.11.2) with SMTP id i1RNIqZ13971; Fri, 27 Feb 2004 17:18:52 -0600 Received: by localhost with Microsoft MAPI; Fri, 27 Feb 2004 17:16:07 -0600 Message-ID: <01C3FD55.6370F320.kmillikin@atcorp.com> From: "Kevin S. Millikin" Reply-To: "kmillikin@atcorp.com" To: "'Basile STARYNKEVITCH'" , "caml-list@inria.fr" Subject: RE: [Caml-list] Semantics of physical equality Date: Fri, 27 Feb 2004 17:16:06 -0600 Organization: ATC X-Mailer: Microsoft Internet E-mail/MAPI - 8.0.0.4211 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Miltered: at concorde by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 2004:99 basile:01 basile:01 2004:99 0600,:01 malloc:01 hypothesis:01 demonstrate:01 michal:01 moskal:01 bool:01 semantics:01 semantics:01 equality:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Friday, February 27, 2004 3:32 PM, Basile STARYNKEVITCH [SMTP:basile@starynkevitch.net] wrote: >> On Fri, Feb 27, 2004 at 02:29:50PM -0600, Kevin S. Millikin >> wrote: >> >> # V1(0) == V1(0);; - : bool = false >> >> V1's are different. Is this guaranteed? >> What do you mean by guaranteed? I mean ``guaranteed'' in the sense that separate calls to cons in Scheme are guaranteed to produce objects that are distinct (according to eqv? and eq?), or that a call to malloc in C is guaranteed to never return a pointer that is the same as any other currently valid pointer in the program (according to ==). >> Why would you want a guarantee that V1 0 is not physically equal >> to V1 0? I tend to think that making such an hypothesis is >> dangerous and wrong, even if the current implementation >> demonstrate it. For the same reason that I occasionally rely on separate cons cells not being eq? in Scheme ;). In the current problem, it can save me a great deal of effort involved in generating temporary identifiers that are guaranteed to be unique, and in wrapping library data structures that I am unwilling to change in order merely to tag them. I realize that it would be dangerous and wrong to rely on them being == if the semantics of value constructors and == did not guarantee they would be. So I guess that's my question: "is it dangerous and wrong to rely on separately constructed values being different according to ==?". -- Kevin PS: Anyway, it looks like Michal Moskal has answered in the negative. Neither behavior is guaranteed, which is an acceptable answer (though not the one I was looking for). ------------------- 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