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: Sat, 1 Aug 2020 22:56:24 +0200 Organization: Aioe.org NNTP Server Message-ID: References: <94a54092-a56f-4a99-aaec-08dd611c8fd8@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.11.0 X-Notice: Filtered by postfilter v. 0.9.2 Content-Language: en-US Xref: reader01.eternal-september.org comp.lang.ada:59626 List-Id: On 01/08/2020 22:35, Stephen Davies wrote: > On Saturday, 1 August 2020 at 13:58:10 UTC+1, Dmitry A. Kazakov wrote: >> On 01/08/2020 13:22, Stephen Davies wrote: >>> type Node_Type (<>) is record >>> Item : Element_Type; >>> Prev : Node_Ptr_Type; >>> Next : Node_Ptr_Type; >>> end record; >>> The rules for such records would be the same as for discriminated ones, >>> except that instead of usages needing to provide values for discriminants, >>> they would need to provide values for indefinite components. >> 1. There is no discriminants for cases when Item is T'Class. >> 2. You cannot get discriminant from the value in the case of Rosen trick... >> 3. Copying is involved. There should be none, especially for limited types... > I'm mainly talking about situations in which there doesn't need to be a > discriminant at all, e.g. when Element_Type is an indefinite non-limited > generic parameter. In other words, Node_Type would then also be indefinite, > but not discriminated. In my view all indefinite types are discriminated, though some discriminants are anonymous or represented by attributes, per language design irregularities. E.g. T'Class is discriminated by the type tag. Array bounds must clearly be discriminants etc. Each constraint must be expressed in terms of discriminants. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de