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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Does object renaming allow the view to be a copy? Date: Mon, 23 Jan 2017 12:06:31 +0100 Organization: Aioe.org NNTP Server Message-ID: References: <037bcf19-7753-459e-afa5-773b7ee82246@googlegroups.com> <799c0fc3-2e01-4d53-bb4b-afd7a6c2b13d@googlegroups.com> NNTP-Posting-Host: vZYCW951TbFitc4GdEwQJg.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:33132 Date: 2017-01-23T12:06:31+01:00 List-Id: 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