From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-65-14.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!reader01.eternal-september.org!aioe.org!wkzB5gFOhLHjvUsb32RKWQ.user.46.165.242.91.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Calling inherited primitive operations in Ada Date: Fri, 2 Sep 2022 10:48:53 +0200 Organization: Aioe.org NNTP Server Message-ID: References: <67b32db0-c4db-466c-ac13-e597e008c762n@googlegroups.com> <401d6f59-2c28-4dd5-9fa6-fccf33b6d645n@googlegroups.com> <12cc33b1-2c39-4057-8a03-623064b06e8en@googlegroups.com> <672e9bc6-1e53-42cb-a339-9230ab949de9n@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: gioia.aioe.org; logging-data="51460"; posting-host="wkzB5gFOhLHjvUsb32RKWQ.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org"; User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.13.0 X-Notice: Filtered by postfilter v. 0.9.2 Content-Language: en-US Xref: reader01.eternal-september.org comp.lang.ada:64266 List-Id: On 2022-09-02 10:35, amo...@unizar.es wrote: > On Thursday, September 1, 2022 at 11:33:47 PM UTC+2, Jeffrey R.Carter wrote: >> On 2022-09-01 20:54, Emmanuel Briot wrote: > >> As presented, this seems very over complicated. Elements and Definite_Elements >> add no value, and this is just a complex way of writing > > Going in a tangent, and I guess you know perfectly well, but this is caused by the painful duplication of code that Ada pushes you to by not having a native way to abstract storage of definite vs indefinite types. So the provider of a generic library very soon faces this conundrum about duplicating most interfaces, if not implementations, or resort to non-trivial generics, or accept an unnecessary penalty for definite types, or push to the client the definite storage matter. There's simply no satisfying solution here [that I know of]. The duplication of every standard container to have both [in]definite variants is a strong indictment. > > I can understand the desire to have full control of allocation and object sizes, but that there's not a language way to work around this duplication, with appropriate restrictions to go with it, is... bothersome. Not making a dig at the ARG, which I understand is overstretched as it is. Containers should be implementable without generics. Just saying. > There was a proposal circulating some time ago that seemed promising, that I can't quickly find. Something like > > type Blah is record > Dont_care_if_in_heap: new Whatever_Definiteness; -- Would apply to indefinite types or formals > end record; I would prefer constraint propagation/management support + tuples instead: type Blah (Parameters : Whatever_Definiteness'Constraints) is Sill_Care : Whatever_Definiteness (Parameters); end record; -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de