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!gandalf.srv.welterde.de!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Ada reference manual rule for doubled parentheses around if_expression? Date: Mon, 3 Aug 2015 17:56:19 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <864mkkz2hy.fsf@stephe-leake.org> <87r3nokwpf.fsf@theworld.com><86r3nnjrv2.fsf@stephe-leake.org> <87mvybktvt.fsf@theworld.com> NNTP-Posting-Host: rrsoftware.com X-Trace: loke.gir.dk 1438642593 7844 24.196.82.226 (3 Aug 2015 22:56:33 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Mon, 3 Aug 2015 22:56:33 +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:27346 Date: 2015-08-03T17:56:19-05:00 List-Id: "Bob Duff" wrote in message news:87mvybktvt.fsf@theworld.com... > Stephen Leake writes: > ... >> GNAT also accepts this: >> >> function Expression_Function_1 (V : Integer) return Boolean >> is (V = V and then True) >> or else True; >> >> I think that's a bug, because there are no parens surrounding the >> entire expression. > > I agree that's a bug. It doesn't seem to have anything to do with the > special rules about conditional/quantified expressions. Or does it? > > If you report this to report@adacore.com, it will get fixed. Looks like a bug to me, too. I remembered that we had changed something about these, but what it was was to accept an aggregate as well as a parenthesized expression: function Expression_Function_1 (V : Integer) return Rec is (A => 1, B => V); rather than function Expression_Function_1 (V : Integer) return Rec is ((A => 1, B => V)); This was another case of double paren elimination. But of course we don't have any rules that eliminate all parens! Randy.