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 11:49:28 +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: 8bit 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 Content-Language: en-US X-Notice: Filtered by postfilter v. 0.9.2 Xref: reader01.eternal-september.org comp.lang.ada:59543 List-Id: On 27/07/2020 11:21, J-P. Rosen wrote: > Le 27/07/2020 à 09:47, Yannick Moy a écrit : >>> My proposal is that it should (sometimes?) be possible to declare >>> objects of indefinite types such as String and have the compiler >>> automatically declare the space for them without the programmer >>> having to resort to access types. >> I agree with the goal. >> > You have it already. It's called Unbounded_String. Not really. 1. Unbounded_String is a compromise needed when the string length change during its life. The great majority of cases allocate [and initialize] a string just once. [addressed to be the cases when using a discriminant does not work] 2. There is nothing for arrays that are not strings and for other indefinite types. E.g.: type Node_Type is record Item : new Element_Type'Class; Prev : Node_Ptr_Type; Next : Node_Ptr_Type; end record; 3. There is nothing for serialization and marshaling objects logically containing strings and other indefinite types. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de