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: Interesting article on ARG work Date: Wed, 4 Apr 2018 17:30:43 -0500 Organization: JSA Research & Innovation Message-ID: References: <1b44444f-c1b3-414e-84fb-8798961487c3@googlegroups.com> <62ee0aac-49da-4925-b9aa-a16695b3fc45@googlegroups.com> <9879872e-c18a-4667-afe5-41ce0f54559f@googlegroups.com> Injection-Date: Wed, 4 Apr 2018 22:30:44 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="9955"; 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:51334 Date: 2018-04-04T17:30:43-05:00 List-Id: "Dan'l Miller" wrote in message news:9879872e-c18a-4667-afe5-41ce0f54559f@googlegroups.com... >On Tuesday, April 3, 2018 at 5:33:47 PM UTC-5, Randy Brukardt wrote: >> I'm not sure what your idea is. The pragma Assert exists already, what is >> it >> that you can't do with it that you need? ... >> "Bojan Bozovic" wrote in message >> > Pragma assert(condition,message); >> > Construct >> > Assertion name is condition with message; > >Randy, despite your humor in the original posting, I think that he is >(seriously) proposing ... I presumed he was serious, I just didn't understand what he was proposing... >...that assertions optionally be named so that the named condition and >message pair is defined in one place and then utilized at the (numerous) >places where the assertion appears, so that the condition & message do >not vary due to the drift of time, forgetfulness, and whim of different >programmers. ... Humm, I suppose that could have been it. Or it could be that that is something you want... There is a much more general proposal for Ada 2020 called "ghost code" - a silly name for code and declarations intended only to be used by assertions. (The idea being that if it is marked and enforced as such, it can be removed when the Assertion_Policy is Ignore.) Using that (which may or may not make it into Ada 2020 -- we haven't yet discussed it at a meeting), one could use a ghost function for this purpose: function My_Assertion (...) return Boolean is (if Condition then raise Assertion_Error with Message else True) with Ghost; pragma Assert (My_Assertion (...)); (Note: The "..." here is any objects that Condition needs to be evaluated.) This works now (without the "ghost") and is more general in that one can pass parameters if needed which would be a problem with the syntax proposed. >... there is no MetaAda that declares all language principles (preferably > in code that compiler vendors would take as input when writing a >compiler, instead of taking in English prose). "Everything shall be >able to be named; that name shall be utilizable to assure uniformity at >each point of usage to the named declaration." would be one of those >statements in MetaAda, most likely stated in something resembling a >language isomorphic to symbolic logic instead of quick-&-dirty English >prose here. I suspect it would be a huge job to get consensus on such MetaAda rules. While I tend to agree with your rule, it's clear that the Ada 95 designers did not. In particular, anonymous access types have various capabilities not available to their named counterparts (going back to Ada 95 anonymous access parameters). This has gotten worse with each new version. I've spent some time complaining about that, but there is only so much that any one person can do. Randy.