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!gz+JwLUglqIuIsOsQSSzqA.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, 29 Jun 2022 09:24:36 +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="9450"; posting-host="gz+JwLUglqIuIsOsQSSzqA.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: reader01.eternal-september.org comp.lang.ada:64047 List-Id: On 2022-06-29 06:07, Randy Brukardt wrote: > What you say here is precisely how they should work. But you would make the > cost of supporting that necessary on every array object, because one could > not know when an array is passed as a parameter what sort of representation > it has. So one has to use dispatching helper operations to implement all > assignments. And that's way more expensive than traditional array > implementation. It is already there because Ada 83 arrays have definite and indefinite representations. Adding a user-defined representation on top is nothing. > If you didn't have slices that could be passed as array parameters, then > that problem does not exist. And I don't think slices are sufficiently > worthwhile to force expensive, unoptimizable code. You still must be able to pass a definite array for indefinite argument and conversely. Slices change nothing. The language must expose subtype conversions per adding removing constraints to the user. This is what definite/indefinite and slicing does. But also, it is what the type tag could be for class-wide arrays or scalar types. I am talking about Integer'Class. And it is what measurement units constraints are. There should be a universal mechanism of dealing with type constraints unifying discriminants/tags/bounds. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de