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!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Interesting article on ARG work Date: Sun, 8 Apr 2018 09:46:13 +0200 Organization: Aioe.org NNTP Server Message-ID: References: <1b44444f-c1b3-414e-84fb-8798961487c3@googlegroups.com> <62ee0aac-49da-4925-b9aa-a16695b3fc45@googlegroups.com> <9879872e-c18a-4667-afe5-41ce0f54559f@googlegroups.com> <80db2d05-744f-4201-ba1b-4436f8040491@googlegroups.com> <59f9ab6d-d6ba-45ff-a6f0-c5699983d9e8@googlegroups.com> NNTP-Posting-Host: kQkuQcRDy1QFvWpyB1foYw.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 Content-Language: en-US X-Notice: Filtered by postfilter v. 0.8.3 Xref: reader02.eternal-september.org comp.lang.ada:51397 Date: 2018-04-08T09:46:13+02:00 List-Id: 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