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, XPRIO autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: New aggregates with Ada 2022. Date: Tue, 21 Jun 2022 18:39:43 -0500 Organization: A noiseless patient Spider Message-ID: References: Injection-Date: Tue, 21 Jun 2022 23:39:45 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="3943c1bd97a1959445a9f71f871aed17"; logging-data="10573"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+zezZrmglDpP5FTBYAolX+Y7/Tg0ZN7nE=" Cancel-Lock: sha1:anJYfg2geoysbTRzJ5KM0epzi6Q= X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246 X-RFC2646: Format=Flowed; Response X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-Priority: 3 X-MSMail-Priority: Normal Xref: reader02.eternal-september.org comp.lang.ada:64009 List-Id: "Dmitry A. Kazakov" wrote in message news:t8qrmo$p79$1@gioia.aioe.org... ... > 1. Built-in operations -> hiding: > > type T is private; > function "+" (Left, Right : T) return T; -- Perfectly legal > private > type T is range 1..100; > > 2. Primitive operations -> overriding. BTW, these two are really the same thing. In the first example, the "+" is overriding the predefined operation. But note an important difference here from the aggregate case: in no case is an operation available for the private type that is *not* available for the full view. Since the syntax and semantics of container aggregates and array aggregate are subtly different (they are as close as we could make them, but that is not that close), there definitely are things that would be only possible when written for the private view. That would be new for Ada. So while a definition could be made, it would be confusing in some cases. And this case isn't useful enough to make that effort. BTW2, there are many things in Ada that would be possible with effort but are illegal for one reason or another. Part of the reason for doing that is that it is always possible to allow such things in the future -- that would be a compatible change. OTOH, defining them sloppily would leave us stuck forever with an expensive and relatively useless feature. For instance, the rather strict limitations on the use and contents of a declare expression fall into that category. Allowing more would be possible, but it would have far-reaching effects on compilers and on the language definition. Not worth the cost at this point, perhaps that will change. Randy. .