From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Interesting article on ARG work
Date: Sun, 8 Apr 2018 09:46:13 +0200
Date: 2018-04-08T09:46:13+02:00 [thread overview]
Message-ID: <pachc4$mkr$1@gioia.aioe.org> (raw)
In-Reply-To: 59f9ab6d-d6ba-45ff-a6f0-c5699983d9e8@googlegroups.com
On 2018-04-08 02:14, Dan'l Miller wrote:
> On Saturday, April 7, 2018 at 11:00:02 AM UTC-5, Dmitry A. Kazakov wrote:
>> On 2018-04-07 17:27, Dan'l Miller wrote:
>>> On Saturday, April 7, 2018 at 5:11:35 AM UTC-5, Dmitry A. Kazakov wrote:
>>>> On 2018-04-07 04:25, Randy Brukardt wrote:
>>>>
>>>>> The biggest problem with a lexical solution (and the reason that Ichbiah
>>>>> hated them) is that it's trivial to accidentally create a program that is
>>>>> only legal in one mode or the other. One has to continually compile
>>>>> everything in each possible mode to ensure that there aren't silly syntax
>>>>> errors involved. A common mistake that I make all of the time is:
>>>>>
>>>>> if Foo then
>>>>> Bar;
>>>>> else
>>>>> @ Internal_Error;
>>>>> end if;
>>>>>
>>>>> With the conditional compilation off, the "Internal_Error" is commented out
>>>>> and the above isn't syntactically legal.
>>>>
>>>> Yes, this is important but I think this could be resolved, e.g. by
>>>> compiling conditionals into corresponding null-effect constructs.
>>>
>>> Yeah, right. This is an artificially contrived “problem” that is in fact not extant in reality. Simply put the @ symbols in front of the •entire• construct to elide: the entire else branch.
>>>
>>> if Foo then
>>> Bar;
>>> @ else
>>> @ Internal_Error;
>>> endif;
>>>
>>
>> "@ else"
>> "@ Internal_Error;"
>>
>> Is not a valid sequence of statements.
>
> That is a non sequitur, Dmitry.
>
> if Foo then
> Bar;
> @ else
> @ Internal_Error;
> endif;
>
> produces either this legal Ada if-else statement,
[...]
ARM 5.1 (2/3) defines sequence of statements. "else Internal_Error;" is
not a sequence of statements. The rule is simple, you can insert only
complete statements.
if Foo then
@ Bar;
@ end if;
@ if Boo then
Baz;
end if;
would not be legal either.
More complicated rules are required for declarations, e.g. that
conditionally declared entities would not be visible outside conditional
code:
declare
@ X : Integer;
Y : Integer;
begin
Y := X; -- This is illegal
@ Y := X; -- This is OK
end;
or
@ with Text_IO;
use Text_IO; -- No, that does not work
--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
next prev parent reply other threads:[~2018-04-08 7:46 UTC|newest]
Thread overview: 57+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-02 3:32 Interesting article on ARG work Randy Brukardt
2018-04-02 14:49 ` Dan'l Miller
2018-04-03 16:34 ` Bojan Bozovic
2018-04-03 22:33 ` Randy Brukardt
2018-04-04 2:12 ` Bojan Bozovic
2018-04-04 15:05 ` Dan'l Miller
2018-04-04 15:30 ` gerdien.de.kruyf
2018-04-04 16:09 ` Dan'l Miller
2018-04-04 22:30 ` Randy Brukardt
2018-04-04 22:43 ` Paul Rubin
2018-04-05 0:44 ` Mehdi Saada
2018-04-05 21:23 ` Randy Brukardt
2018-04-05 2:05 ` Bojan Bozovic
2018-04-05 22:12 ` Randy Brukardt
2018-04-06 13:35 ` Bojan Bozovic
2018-04-07 2:01 ` Randy Brukardt
2018-04-05 7:21 ` Dmitry A. Kazakov
2018-04-05 22:18 ` Randy Brukardt
2018-04-06 7:30 ` Dmitry A. Kazakov
2018-04-07 2:25 ` Randy Brukardt
2018-04-07 10:11 ` Dmitry A. Kazakov
2018-04-07 15:27 ` Dan'l Miller
2018-04-07 15:59 ` Dmitry A. Kazakov
2018-04-08 0:14 ` Dan'l Miller
2018-04-08 7:46 ` Dmitry A. Kazakov [this message]
2018-04-08 19:48 ` Dan'l Miller
2018-04-08 20:09 ` Dmitry A. Kazakov
2018-04-09 3:50 ` Dan'l Miller
2018-04-09 6:40 ` Jan de Kruyf
2018-04-09 7:43 ` Dmitry A. Kazakov
2018-04-09 13:40 ` Dan'l Miller
2018-04-09 14:13 ` Dmitry A. Kazakov
2018-04-09 14:36 ` Dan'l Miller
2018-04-09 14:44 ` Dmitry A. Kazakov
2018-04-09 15:03 ` Dan'l Miller
2018-04-09 16:12 ` Niklas Holsti
2018-04-09 16:30 ` Dmitry A. Kazakov
2018-04-09 16:45 ` Niklas Holsti
2018-04-09 17:33 ` Dan'l Miller
2018-04-09 19:47 ` Dmitry A. Kazakov
2018-04-09 20:24 ` Randy Brukardt
2018-04-10 8:17 ` Dmitry A. Kazakov
2018-04-09 18:08 ` Dan'l Miller
2018-04-09 21:17 ` Niklas Holsti
2018-04-09 22:09 ` Dan'l Miller
2018-04-10 19:23 ` Niklas Holsti
2018-04-10 19:46 ` Dan'l Miller
2018-04-15 7:50 ` Niklas Holsti
2018-04-15 13:31 ` Dan'l Miller
2018-04-15 18:37 ` Niklas Holsti
2018-04-09 20:14 ` Randy Brukardt
2018-04-06 23:49 ` Dan'l Miller
2018-04-12 10:21 ` Marius Amado-Alves
2018-04-15 13:07 ` Ada conditional compilation and program variants Niklas Holsti
2018-05-07 8:41 ` Jacob Sparre Andersen
2018-04-06 13:35 ` Interesting article on ARG work Marius Amado-Alves
2018-04-07 2:15 ` Randy Brukardt
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox