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: Sat, 7 Apr 2018 17:59:58 +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> 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:51382 Date: 2018-04-07T17:59:58+02:00 List-Id: 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. The point is that like with pragma, the conditional must be a syntactic entity, e.g. a sequence of statements, a Boolean-valued expression, a declaration, not just a sequence of characters. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de