comp.lang.ada
 help / color / mirror / Atom feed
From: Bojan Bozovic <bozovic.bojan@gmail.com>
Subject: Re: Interesting article on ARG work
Date: Wed, 4 Apr 2018 19:05:38 -0700 (PDT)
Date: 2018-04-04T19:05:38-07:00	[thread overview]
Message-ID: <17b6d5b9-5909-4f0c-ab25-9b3cf4fd0450@googlegroups.com> (raw)
In-Reply-To: <pa3jmj$9n3$1@franka.jacob-sparre.dk>

On Thursday, April 5, 2018 at 12:30:46 AM UTC+2, Randy Brukardt wrote:
> "Dan'l Miller" <optikos@verizon.net> 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.

Ah I was victim of April the 1st joke! I wasn't joking though. My proposal was to add assertions in general to Ada, as something in the core language, like exceptions are, or tasks, which would function just as "ghost code" you had in mind when

pragma assertion_policy (check);

is used. Maybe not use assertion keyword but use functions with ghost? I really can't say which approach wold work best, from the point of function, readability and conciseness. That is for ARG to decide.

  parent reply	other threads:[~2018-04-05  2:05 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 [this message]
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
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