comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Does object renaming allow the view to be a copy?
Date: Mon, 23 Jan 2017 12:06:31 +0100
Date: 2017-01-23T12:06:31+01:00	[thread overview]
Message-ID: <o64o3m$1srm$1@gioia.aioe.org> (raw)
In-Reply-To: 799c0fc3-2e01-4d53-bb4b-afd7a6c2b13d@googlegroups.com

On 23/01/2017 11:49, AdaMagica wrote:
> Am Sonntag, 22. Januar 2017 21:24:12 UTC+1 schrieb Dmitry A. Kazakov:
>> On 2017-01-22 18:37, Simon Wright wrote:
> ...
>>> But like I said, crazy. Under the hood, any sensible person would have a
>>> reference to the original object.
>>
>> Some packed Boolean, not at the storage element margin?
>
> Of course not in cases like that:
>
> type Set is array (Index) of Boolean with Packed;
> My_Set: Set;
>
> My_Element_Presence: Boolean renames My_Set (I);
>
> My_Set (I) := not My_Set (I);
> My_Element_Presence := not My_Element_Presence;
>
> Under the hood, the same packing and unpacking has to be performed. A
> simple reference is impossible in this case.

Yes, renaming/viewing is richer than mere referencing. It is similar to 
parameter passing when the compiler is free to use any method.

(IMO being conceptually same as parameter passing, renaming must support 
array index sliding and other translations of the constraints as 
requested by the declared view).

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

  reply	other threads:[~2017-01-23 11:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-22  8:27 Does object renaming allow the view to be a copy? G.B.
2017-01-22 10:37 ` Simon Wright
2017-01-22 16:26 ` AdaMagica
2017-01-22 17:37   ` Simon Wright
2017-01-22 20:24     ` Dmitry A. Kazakov
2017-01-23 10:49       ` AdaMagica
2017-01-23 11:06         ` Dmitry A. Kazakov [this message]
2017-01-23 20:40 ` Randy Brukardt
2017-01-24 16:06   ` Robert Eachus
2017-01-24 21:08     ` Randy Brukardt
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox