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!reader02.eternal-september.org!aioe.org!siG8trSPtxwtkBCOZpBn8A.user.46.165.242.91.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: New aggregates with Ada 2022. Date: Wed, 22 Jun 2022 11:04:09 +0200 Organization: Aioe.org NNTP Server Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: gioia.aioe.org; logging-data="19850"; posting-host="siG8trSPtxwtkBCOZpBn8A.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.10.0 X-Notice: Filtered by postfilter v. 0.9.2 Content-Language: en-US Xref: reader02.eternal-september.org comp.lang.ada:64013 List-Id: On 2022-06-22 01:28, Randy Brukardt wrote: > This case is not worth the effort, IMHO. (Of course, it is in the language > now, so we're stuck with it.) If I was running the circus, private types > could only be completed with a record type. Just like aggregates now, record types *must* have interface. Your "circus" will inevitable face this same problem again - how to define record members of a private type implemented by a built-in record type in the full view? The language must universally handle all sorts of interfaces. > The problem here is illustrated by the OP, who seemed to expect to get the > container aggregate when the full view is visible. We looked at making the > container aggregate invisible and allowing the array aggregate in the full > view, but it would be something new (the contents of aggregates don't depend > on visibility in Ada 2012), and it seems useless (see my answer to [1]). I would first answer basic questions, which interfaces have array vs user-defined aggregate/index. How are they related to each other etc. > That is, the OPs construct is primarily useful in small examples; it's not a > real world thing you would want to do. (There ALWAYS is some other data that > you need to go along with an array: a length, a validity flag, etc.) So why > make implementers spend a lot of effort implementing it?? Well, I can give a useful example straight away. A string has two array interfaces, the encoding and the character view. The former must be a built-in array. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de