comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Studying and Maintaining GNAT, Is There Any Interest in a New Group?
Date: Tue, 4 Sep 2018 17:05:18 -0500
Date: 2018-09-04T17:05:18-05:00	[thread overview]
Message-ID: <pmmviu$c0k$1@franka.jacob-sparre.dk> (raw)
In-Reply-To: 9cfac5e5-5475-4219-96f1-970a47e91c28@googlegroups.com


"AdaMagica" <christ-usch.grein@t-online.de> 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.


  reply	other threads:[~2018-09-04 22:05 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-25 12:27 Studying and Maintaining GNAT, Is There Any Interest in a New Group? patrick
2018-08-25 13:56 ` Dan'l Miller
2018-08-25 16:00   ` patrick
2018-08-25 16:16 ` Luke A. Guest
2018-08-25 17:42   ` patrick
2018-08-25 19:25     ` Simon Wright
2018-08-25 20:24       ` patrick
2018-08-25 21:48         ` Luke A. Guest
2018-08-25 21:53           ` patrick
2018-08-25 22:05             ` Luke A. Guest
2018-08-26 19:54           ` Dan'l Miller
2018-08-26 20:14             ` Dan'l Miller
2018-08-26 22:52             ` Lucretia
2018-08-27  2:38               ` Dan'l Miller
2018-08-27 14:46                 ` Lucretia
2018-08-27 15:42                   ` Dan'l Miller
2018-08-27 21:27               ` Randy Brukardt
2018-08-28  7:26                 ` Dmitry A. Kazakov
2018-08-29  0:16                   ` Randy Brukardt
2018-08-29  8:20                     ` Dmitry A. Kazakov
2018-08-29 21:43                       ` Randy Brukardt
2018-08-30  7:55                         ` Dmitry A. Kazakov
2018-08-30 23:25                           ` Randy Brukardt
2018-08-31  8:48                             ` Dmitry A. Kazakov
2018-08-31 22:42                               ` Randy Brukardt
2018-09-02  8:02                                 ` Dmitry A. Kazakov
2018-09-04 22:18                                   ` Randy Brukardt
2018-08-29  3:02                 ` Paul Rubin
2018-08-29  6:18                   ` Luke A. Guest
2018-08-29 19:00                     ` Paul Rubin
2018-08-30  5:54                       ` Luke A. Guest
2018-08-30  6:29                         ` Paul Rubin
2018-08-27 21:18             ` Randy Brukardt
2018-08-27  9:37           ` Simon Wright
2018-08-27 16:54             ` Bill Findlay
2018-08-27 17:42               ` Shark8
2018-08-31 21:23                 ` Robert A Duff
2018-08-31 22:51                   ` Randy Brukardt
2018-09-01 19:42                     ` Robert A Duff
2018-09-02  8:04                       ` Dmitry A. Kazakov
2018-09-02 10:11                     ` AdaMagica
2018-09-02 12:10                       ` Jeffrey R. Carter
2018-09-02 14:30                         ` AdaMagica
2018-09-04 22:05                           ` Randy Brukardt [this message]
2018-09-01  7:41               ` Simon Wright
2018-09-01 17:27                 ` Bill Findlay
2018-08-27 17:35         ` Shark8
2018-08-25 21:17       ` Luke A. Guest
2018-08-25 23:16       ` Paul Rubin
2018-08-26  8:03         ` Rene
2018-08-26 10:09         ` Simon Wright
2018-08-25 16:43 ` Jeffrey R. Carter
2018-08-25 17:38   ` patrick
2018-08-25 17:39     ` Luke A. Guest
2018-08-25 17:45       ` patrick
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox