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!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: relax double parens in expression_function_declaration? Date: Mon, 20 Feb 2017 21:16:18 +0000 Organization: A noiseless patient Spider Message-ID: References: <864b4b14-5c42-4ddc-92ee-ad76ce2be159@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="e5f2c4e23eb25f230b41e4d4fc991e06"; logging-data="10332"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/REhfRdWjF4c5grxTs2C9PnRnhxQX1+0M=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (darwin) Cancel-Lock: sha1:0H3K+UcWAVnjPLoSUanPzL58xco= sha1:uv0CY2yTDAO9Q+ym0emPnmGn2QY= Xref: news.eternal-september.org comp.lang.ada:33368 Date: 2017-02-20T21:16:18+00:00 List-Id: Stephen Leake writes: > However, I can't find a rule in the ARM that allows it. > ARM 6.8 says: > > expression_function_declaration ::= > [overriding_indicator] > function_specification is > (expression) > [aspect_specification]; 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, '|'. > This requires double parens: > > function Key return Result is > ((A => 1, > B => 2)); > > 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!