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!feeder.eternal-september.org!gandalf.srv.welterde.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Studying and Maintaining GNAT, Is There Any Interest in a New Group? Date: Tue, 4 Sep 2018 17:05:18 -0500 Organization: JSA Research & Innovation Message-ID: References: <309225242.556906218.575482.laguest-archeia.com@nntp.aioe.org> <2145221813.556924687.162377.laguest-archeia.com@nntp.aioe.org> <0001HW.213464550E84375C70000C7DB2CF@news.individual.net> <849e14d4-5790-4951-be18-bc2fa8561051@googlegroups.com> <9cfac5e5-5475-4219-96f1-970a47e91c28@googlegroups.com> Injection-Date: Tue, 4 Sep 2018 22:05:18 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="12308"; mail-complaints-to="news@jacob-sparre.dk" 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.7246 Xref: reader02.eternal-september.org comp.lang.ada:54316 Date: 2018-09-04T17:05:18-05:00 List-Id: "AdaMagica" wrote in message news:9cfac5e5-5475-4219-96f1-970a47e91c28@googlegroups.com... > Am Sonntag, 2. September 2018 14:10:36 UTC+2 schrieb Jeffrey R. Carter: >> On 09/02/2018 12:11 PM, AdaMagica wrote: >> > Am Samstag, 1. September 2018 00:51:42 UTC+2 schrieb Randy Brukardt: >> >> Similarly, in Ada 2012: >> >> Ren1 : Natural renames Func(1); -- Legal. >> >> Ren2 : Natural renames Natural'(Func(1)); -- Legal. >> >> Ren3 : Natural renames Natural(Func(1)); -- Illegal!!! >> >> >> >> At least Ada 2020 will fix this one. But try this: >> >> Ren4 : Boolean renames Boolean'(A and B); -- Legal. >> >> Ren5 : Boolean renames Boolean'(A and then B); -- Illegal. >> >> Ren6 : Boolean renames "and"(A, B); -- Legal. >> >> Ren7 : Boolean renames A and B; -- Illegal. >> > >> > Ahem, perhaps my Gnat 2018 is not correct, but it rejects only Ren7, >> > which is an expression, and that cannot be renamed according to syntax. >> >> FSF GNAT 8.0.1 rejects all 3: >> >> $ gnatmake renaming.ads >> gcc-8 -c renaming.ads >> renaming.ads:9:27: renaming of conversion only allowed for tagged types >> renaming.ads:11:34: expect object name in renaming > I guess this is Ren5. > Why should Ren4 be legal? Also "A and B" is an expression, not an object. > "and"(A,B) is a function call, thus an object, whereas infix "and" in Ren4 > is not a function call, but an expression. > > Ah, I found AARM 6.4(3.a/3). This makes Ren4 legal. > So of course "and then" not being an operator, the expression in Ren5 is > not considered a function call. > > Truly bizarre rules. Yup. For what it's worth, I started investigating this when I was writing an ACATS test to check that "a qualified expression of an object is an object" and the inverse. So that ACATS test is relatively new and GNAT probaby was changed to do this exactly right at that time. (It's not the sort of case an implementer is likely to worry about absent a test). Randy.