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=-3.2 required=3.0 tests=BAYES_00,NICE_REPLY_A, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R.Carter" Newsgroups: comp.lang.ada Subject: Re: New aggregates with Ada 2022. Date: Wed, 29 Jun 2022 10:30:20 +0200 Organization: A noiseless patient Spider Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Wed, 29 Jun 2022 08:30:20 -0000 (UTC) Injection-Info: reader01.eternal-september.org; posting-host="f0eedd88e4429dcbcad6ebcd7d070c13"; logging-data="1463013"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19fBbxNSGHuV5AHCrwTBgkp9rgkVZvAY2k=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Cancel-Lock: sha1:bPqn9RUll/rz8uuiz1VCc7EkUEw= In-Reply-To: Content-Language: en-US Xref: reader01.eternal-september.org comp.lang.ada:64048 List-Id: On 2022-06-29 06:01, Randy Brukardt wrote: > > But there is (or shouldn't be) anything special about a one-dimensional > array (presuming you intend to allow arrays with more dimensions). And the > "abstraction" you talk about is selecting a bunch of barely related elements > from a multi-dimensional array. Arrays are usually used to implement map, (mathematical) matrices and vectors, or sequences. Each usage tends to have unique features: * Maps are usually constrained. It does not make sense to concatenate, sort, slice, or slide a map. The abstraction of a map includes non-discrete key subtypes, so arrays used as maps are a special case. * Matrices have component types that behave like numbers. The mathematical definition of matrices includes integer indices with a lower bound of 1. Vectors are usually considered to be matrices of one column ("column vector") which can be transposed to obtain matrices of one row ("row vector"). * Sequences are usually unconstrained. Typical discussion of sequences outside of programming use integer values to indicate positions, using terms such as the first thing in a sequence, the second thing, ..., so indices should be of an integer type with a lower bound of 1. It sometimes makes sense to concatenate, sort, slice, or slide sequences. A language that provided direct support for these abstractions should not need to provide arrays. -- Jeff Carter "[T]he language [Ada] incorporates many excellent structural features which have proved their value in many precursor languages ..." C. A. R. Hoare 180