From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!au2pb.net!feeder.erje.net!2.us.feeder.erje.net!nntp.club.cc.cmu.edu!micro-heart-of-gold.mit.edu!newsswitch.lcs.mit.edu!nntp.TheWorld.com!.POSTED!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Mixing operators and dot notation Date: Thu, 02 Jun 2016 18:28:40 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: NNTP-Posting-Host: shell02.theworld.com Mime-Version: 1.0 Content-Type: text/plain X-Trace: pcls7.std.com 1464906482 30044 192.74.137.72 (2 Jun 2016 22:28:02 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Thu, 2 Jun 2016 22:28:02 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Cancel-Lock: sha1:ENIc30tCE2xOcOfIIzQck+Vkl9o= Xref: news.eternal-september.org comp.lang.ada:30559 Date: 2016-06-02T18:28:40-04:00 List-Id: "Alejandro R. Mosteo" 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