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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,dc1fff2721602dfa X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit X-Received: by 10.66.76.201 with SMTP id m9mr1328443paw.33.1359647369738; Thu, 31 Jan 2013 07:49:29 -0800 (PST) X-Received: by 10.50.45.170 with SMTP id o10mr235638igm.17.1359647369691; Thu, 31 Jan 2013 07:49:29 -0800 (PST) Path: 6ni26604pbd.1!nntp.google.com!f6no7580733pbd.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 31 Jan 2013 07:49:29 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ NNTP-Posting-Host: 66.126.103.122 References: <4978d638-a04b-4561-85e9-cf6620265af2@googlegroups.com> <86boc63n5d.fsf@gaheris.avalon.lan> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <619a9cd8-ba12-4d25-b1b9-de30d416b54a@googlegroups.com> Subject: Re: Ada and string literals From: Adam Beneschan Injection-Date: Thu, 31 Jan 2013 15:49:29 +0000 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2013-01-31T07:49:29-08:00 List-Id: On Wednesday, January 30, 2013 6:23:08 PM UTC-8, Robert A Duff wrote: > Jeffrey Carter writes: > '[Unchecked_]Access is about object identity. > On the other hand 'Address is not -- two objects can have > the same address without being the same object. However, if two objects have the same 'Address, it's hard to imagine them n= ot having the same 'Access as well, in practice. There aren't many cases w= here this is an issue, but: procedure P (Addr : in System.Address) is X : aliased T; for X'Address use Addr; pragma Import (Ada, X); Y : aliased T; for Y'Address use Addr; pragma Import (Ada, Y); XA : T_Acc :=3D X'Access; YA : T_Acc :=3D Y'Access; ... if XA =3D YA then ... end Proc; Assuming T is a simple record type, for instance, I can't imagine XA=3DYA b= eing false in any implementation, even though I believe X and Y are distinc= t objects by the RM's definitions. The additional logic and/or storage req= uired to make sure XA /=3D YA would be unacceptable distributed overhead. (This may or may not apply to unconstrained String subtypes such as in the = example; if an implementation already uses an implicit level of indirection= somewhere to implement those, then it may be possible that 'Address would = be the same and 'Access different without any additional overhead.) -- Adam=20