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!news.eternal-september.org!feeder.eternal-september.org!gandalf.srv.welterde.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: relax double parens in expression_function_declaration? Date: Mon, 20 Feb 2017 16:11:01 -0600 Organization: JSA Research & Innovation Message-ID: References: <864b4b14-5c42-4ddc-92ee-ad76ce2be159@googlegroups.com> NNTP-Posting-Host: rrsoftware.com X-Trace: franka.jacob-sparre.dk 1487628662 7319 24.196.82.226 (20 Feb 2017 22:11:02 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Mon, 20 Feb 2017 22:11:02 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: news.eternal-september.org comp.lang.ada:33370 Date: 2017-02-20T16:11:01-06:00 List-Id: "Simon Wright" wrote in message news:lybmtwk1gd.fsf@pushface.org... ... > Actually there is, I think, a typo: the first semicolon in > http://www.ada-auth.org/standards/rm12_w_tc1/html/RM-6-8.html#p2 should > be a pipe, '|'. ???. The declaration ends with a semicolon, and since the next line starts with a pipe, it's clearly not missing. ... >> ARM 4.5.7(7) gives permission to remove the double parens for >> conditional_expression; is there a similar rule or AI for aggregates? > > AARM 4.5.7(7.j), > http://www.ada-auth.org/standards/aarm12_w_tc1/html/AA-4-5-7.html#p7.j, > says > > The English-language rule applies in all places that could surround > an expression with parentheses, including pragma arguments, type > conversion and qualified expression operands, and array index > expressions. > > but it's far from clear what that means, & if it applies to aggregates, > why that couldn't have been made explicit in (7) in the first place! That rule doesn't apply to aggregates; we have an explicit rule in 6.8 for the case of aggregates in expression functions. Double parens are required for aggregates in those other contexts (most of which don't allow aggregates anyway - they're illegal for other reasons), or, like qualified exprssions, they also have explicit rules allowing the aggregate without double parens. Mainly what the 4.5.7(7) means is that we didn't want to hack the Ada grammar enough to explicitly eliminate the double parens. (It's not that hard to do -- I did it in the Janus/Ada grammar -- but it does require extensive grammar changes). So we just said that they don't happen for conditional expressions (and quantified expressions -- interestingly, raise_expressions are handled explicitly). Randy.