From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED.2uCIJahv+a4XEBqttj5Vkw.user.gioia.aioe.org!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Proposal: Auto-allocation of Indefinite Objects Date: Mon, 27 Jul 2020 22:02:57 +0200 Organization: Aioe.org NNTP Server Message-ID: References: <94a54092-a56f-4a99-aaec-08dd611c8fd8@googlegroups.com> <8a502b6c-4609-4cd8-b292-5797fe6421e1n@googlegroups.com> NNTP-Posting-Host: 2uCIJahv+a4XEBqttj5Vkw.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 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 X-Notice: Filtered by postfilter v. 0.9.2 Content-Language: en-US Xref: reader01.eternal-september.org comp.lang.ada:59555 List-Id: On 27/07/2020 19:48, Brian Drummond wrote: > 2) can be implemented internally using pointers, but externally appears > to be a data object, just like Unbounded_String does, with similar > semantics. No, the point is that Unbounded_String is exactly opposite to what is required. In no case it should appear as an object of a different type! Compare access to string P with unbounded string U: for I in P'Range loop -- This is OK P(J) := 'a' -- This is OK Now would you do: To_String (U) (J) := 'a' -- Garbage! What if the original object must be a class-wide object, task, protected object, limited object etc? Ada's access types delegate all operations to the target object, except assignment. This is the key property that the proposal in my view must retain. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de