From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,82c7a4dae672250f X-Google-Attributes: gid103376,public From: Jean-Pierre Rosen Subject: Re: "Object" types vs. "Value" types Date: 1996/03/26 Message-ID: <199603261342.OAA03546@email.enst.fr>#1/1 X-Deja-AN: 144339801 sender: Ada programming language x-sender: rosen@email.enst.fr comments: Gated by NETNEWS@AUVM.AMERICAN.EDU content-type: text/plain; charset="us-ascii" mime-version: 1.0 newsgroups: comp.lang.ada x-mailer: Windows Eudora Light Version 1.5.2 Date: 1996-03-26T00:00:00+00:00 List-Id: At 07:24 25/03/1996 -0500, you wrote: >"1) "Value semantics" if Y:=X means that the contents of X is copied into Y. >2) "Reference semantics" if Y:=X means that from now on, X and Y designate >the same object." > >I think this can be a bit confusing, because it describes what are high >level notions in terms of one particular implementation approach. > >Now of course, "as if" applies, so what is meant for example is that >"Value Semantics" if Y := X means that it is AS IF the contents of X > is copied into Y. > >[...] explanation of lazy assignment deleted > >The distinction is indeed critical, but no wonder you got confused talking >about assignment if you immediately started talking about low level >implementation details (use of pointers, and copying of values on >assignment). You need to describe the difference at an operational >semantic level, as I have done here, rather than at an implementation >level. > Yes, of course, I was talking about abstract behaviour. Note that I described it in terms of *private* types (which is actually totally irrelevant to the discussion), just to mean that I intended to described a perceivable behaviour, not an implementation issue. That's also why I tried to give an example of non-pointer reference semantics. So the real issue is the abstract meaning of assignment. Note for example that you can consider pointers as a "value" type (the value being the designation of an object), or directly as a "reference" type. Grossly, this would be the former case for a visible pointer type, and the latter for a private pointer type. +------------------------------------o-------------------------------------+ | P-mail: | E-mail: rosen@enst.fr | | ADALOG - 27 avenue de Verdun | Tel: +33 1 46 45 51 12 | | 92170 Vanves - FRANCE | Fax: +33 1 46 45 52 49 | +------------------------------------o-------------------------------------+