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!nntp-feed.chiark.greenend.org.uk!ewrotcd!newsfeed.xs3.de!io.xs3.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: Fri, 31 Aug 2018 17:51:40 -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> Injection-Date: Fri, 31 Aug 2018 22:51:40 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="8352"; 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:54305 Date: 2018-08-31T17:51:40-05:00 List-Id: "Robert A Duff" wrote in message news:wcc5zzqtels.fsf@TheWorld.com... > Shark8 writes: > >> On Monday, August 27, 2018 at 10:54:48 AM UTC-6, Bill Findlay wrote: >>> On 27 Aug 2018, Simon Wright wrote: >>> > And there are bugs in the backend; e.g. currently some problems with >>> > LTO/Darwin. >>> >>> Could you say more about that, Simon? >>> It might explain some difficulties I have been experiencing. > >> Well, one bug that seems to recur frequently is mishandling of RENAMES, >> and not obscure renamings either, things like attribute renaming: >> Length : Natural renames Some_Array'Length; > > That's illegal, because Some_Array'Length denotes a value, > not an object, so you can't use it like that in an > object_renaming_declaration. GNAT correctly detects > this error. I don't see any mishandling here. > Am I missing something? Probably just that people are very confused about what one can rename. It's completely illogical, but as Bob says, it's a language issue and not (necessarily) a compiler issue. For instance: Next : Natural renames Natural'Pred(1); *is* legal, as Pred represents a function, and function results represent objects. 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. "and" is an operator function here, so it's an object and can be renamed. But "and then" is an operation and thus can't be renamed. Ren7 is illegal be infix notation is not a "name", so this renaming is illegal syntax. Note that every one of these renames was illegal in Ada 83. Someone thought that it was important to allow Ren1 in Ada 95, and that led to all of these bizarre cases. Anyone who claims they understand what can and cannot be renamed intuitively is a liar. :-) Randy.