comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Ada 202x and square brackets
Date: Wed, 20 Feb 2019 17:47:51 -0600
Date: 2019-02-20T17:47:51-06:00	[thread overview]
Message-ID: <q4kov7$40n$1@franka.jacob-sparre.dk> (raw)
In-Reply-To: b773bbfa-9fd0-431a-8ff3-462b2c5ccd15@googlegroups.com

"Lucretia" <laguest9000@googlemail.com> wrote in message 
news:b773bbfa-9fd0-431a-8ff3-462b2c5ccd15@googlegroups.com...
> On Wednesday, 20 February 2019 14:32:14 UTC, Jere  wrote:
>> On Tuesday, February 19, 2019 at 5:01:05 PM UTC-5, Lucretia wrote:
>> > Hi,
>> >
>> > I've noticed whilst looking through the grammar of draft 17 there are a 
>> > lot of new uses of '[' ']' without much explanation. Can someone 
>> > elaborate?
>> >
>> > Ta,
>> > Luke.
>>
>> I know you found it, but for other's benefit, which did you find.  I
>> searched through and found them used in "reduction expressions" [1],
>> but I don't know if that was the only use
>>
>> [1]: http://www.ada-auth.org/standards/2xrm/html/RM-4-5-10.html#I3068
>
> It was aggregates for containers, so you can do Set := [1,2,3,4] or 
> something like that. I didn't read the details.
>
> http://www.ada-auth.org/standards/2xaarm/html/AA-4-3-5.html

You can also use them around array aggregates, so that you can write a 
single component array aggregate:

             My_Arr : constant Some_Unconstrained_Array_Type := [1];

Container aggregates are roughly user-defined array aggrgeates. 
(Alternatively, you can [maybe should] think of an array as a built-in 
container.)

                                  Randy.




  reply	other threads:[~2019-02-20 23:47 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-19 22:01 Ada 202x and square brackets Lucretia
2019-02-19 22:36 ` Lucretia
2019-02-20 14:32 ` Jere
2019-02-20 14:38   ` Jere
2019-02-20 14:58   ` Lucretia
2019-02-20 23:47     ` Randy Brukardt [this message]
2019-02-21  4:27       ` Lucretia
2019-02-22  0:24         ` Randy Brukardt
2019-02-22 10:34           ` AdaMagica
2019-02-22 11:53             ` J-P. Rosen
2019-02-22 12:37               ` AdaMagica
2019-02-22 16:56                 ` J-P. Rosen
2019-02-22 17:09                   ` AdaMagica
2019-02-22 22:18             ` Randy Brukardt
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox