From: Robert A Duff <bobduff@TheWorld.com>
Subject: Re: Mixing operators and dot notation
Date: Thu, 02 Jun 2016 18:28:40 -0400
Date: 2016-06-02T18:28:40-04:00 [thread overview]
Message-ID: <wccshwvgr8n.fsf@TheWorld.com> (raw)
In-Reply-To: niq90k$u7l$1@dont-email.me
"Alejandro R. Mosteo" <alejandro@mosteo.com> writes:
> I'm trying to abuse Ada syntax for nefarious purposes and have arrived
^^^^^ Probably an apt description. ;-)
> at something that looks inconsistent to me, but I fail to see if it is
^^^^^^^^^^^^
Yes, the rules are inconsistent.
> expected behavior or a bug. This is a self-contained example which is
> below.
> Op (1, 2).Method; -- Fine
>
> -- (1 & 2).Method; -- Error: statement expected
That's syntactically illegal; take a look at the BNF.
But you can say:
Nest.Object'Class'(1 & 2).Method;
Ada makes a syntactic distinction between 'name' and 'expression',
which I think is unwise. ARG has been chipping away at it over
the years. Anyway, nowadays, a qualified_expression is a name,
so if you have an expression you want to use as a name, you can
just qualify it.
- Bob
next prev parent reply other threads:[~2016-06-02 22:28 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-02 21:38 Mixing operators and dot notation Alejandro R. Mosteo
2016-06-02 21:42 ` Alejandro R. Mosteo
2016-06-02 22:28 ` Robert A Duff [this message]
2016-06-02 23:26 ` Randy Brukardt
2016-06-03 11:09 ` Alejandro R. Mosteo
2016-06-03 12:19 ` Dmitry A. Kazakov
2016-06-03 14:45 ` G.B.
2016-06-03 17:31 ` Shark8
2016-06-03 20:41 ` Alejandro R. Mosteo
2016-06-06 8:14 ` briot.emmanuel
2016-06-06 13:51 ` Alejandro R. Mosteo
2016-06-07 11:24 ` Traits and iterators (was: Mixing operators and dot notation) Alejandro R. Mosteo
2016-06-08 7:31 ` briot.emmanuel
2016-06-08 11:18 ` Traits and iterators Alejandro R. Mosteo
2016-06-06 8:10 ` Mixing operators and dot notation briot.emmanuel
2016-06-06 13:58 ` Alejandro R. Mosteo
2016-06-02 23:05 ` Jeffrey R. Carter
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox