comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Peculiarities of "of" syntax
Date: Mon, 13 Jan 2020 17:32:36 -0600
Date: 2020-01-13T17:32:36-06:00	[thread overview]
Message-ID: <qviuml$1su$1@franka.jacob-sparre.dk> (raw)
In-Reply-To: 56cb7bc3-b966-4708-8cc7-657712d77047@googlegroups.com

"Alejandro R. Mosteo" <amosteo@unizar.es> wrote in message 
news:56cb7bc3-b966-4708-8cc7-657712d77047@googlegroups.com...
> Yes, apologies about the array declaration error. That was part of an 
> early attempt at an example, I tested it but then forgot to fix it when 
> finishing the post.
>
> Fixing the array will give the errors I mention, and as you point out the 
> grammar specifies a name.
>
> So the question would be, with a correct array, why a name is required 
> instead of an expression,
>or why a qualified expression is good enough but an unambiguous plain 
>expression is not.

A qualified expression, a type conversion, and a function call are all 
"names". You can always use a qualified expression to turn any "expression" 
into a "name".

> A normal function call will work there too, so why not the poor infix 
> operator...

The usual reason is that infix operators would make the grammar ambigious; 
that depends on what follows them. There are cases where that isn't a 
problem (this might be one of them). I don't think anyone was thinking about 
using expressions in this context, the intent was to iterate over an object.

Of course, Bob is right that the difference between "name" and "expression" 
(and similarly "value" and "object") are minor enough that it would be nice 
to eliminate them. (But it's also a lot of work, and we decided not to try 
for Ada 202x.)

                              Randy.


      parent reply	other threads:[~2020-01-13 23:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-11 18:05 Peculiarities of "of" syntax Alejandro R. Mosteo
2020-01-11 20:25 ` Jeffrey R. Carter
2020-01-11 21:45 ` Robert A Duff
2020-01-12  1:38   ` Alejandro R. Mosteo
2020-01-12  2:01     ` Robert A Duff
2020-01-12 11:27     ` Simon Wright
2020-01-13 23:32     ` Randy Brukardt [this message]
replies disabled

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