comp.lang.ada
 help / color / mirror / Atom feed
From: Tucker Taft <stt@averstar.com>
Subject: Re: Assertions
Date: 1999/05/12
Date: 1999-05-12T00:00:00+00:00	[thread overview]
Message-ID: <3739CECA.6A49865B@averstar.com> (raw)
In-Reply-To: 7h83lc$rd$1@nnrp1.deja.com

Robert Dewar wrote:
> 
> In article <3736F549.E3DDCDEB@pwfl.com>,
>   diespammer@pwfl.com wrote:
> >but I think the "pragma Assert" got enough attention that other
> > compiler vendors have implemented it as well, so it is
> > becoming a common
> > - if not standard - feature of the language. I'd expect to see
> > it in some future revision of the ARM.
> 
> I would not! I do not see that the fundamental problems that
> caused Assert not to make it into the Ada 95 RM have been
> solved. For a discussion of these problems, consult the archives
> (we have had that thread at least once, probably more than once
> in recent memory).

Robert is right that there were long discussions on this,
but I think they could still be resolved.  Many of the
Ada 95 compilers have an informally agreed-upon way of
supporing pragma Assert already.  It is often tough
to formalize these informal agreements, but it can be
done, especially when you have existing implementations,
and motivation to allow "reasonable" uses of the feature
to be portable.  

In any case, here is a strawman:

   pragma Assert(boolean_expression [, string_expression]);

This pragma may appear anywhere a declaration or a statement may
occur.  If the check Assertion_Check is suppressed, this pragma
has no effect.  If the check Assertion_Check is not suppressed,
this pragma's elaboration/execution is equivalent to the
execution of:

   if boolean_expression then
        System.Assertions.Raise_Assert_Failure([""|string_expression]);
   end if;

Anyway, this is a strawman, and I presume it will live up
to its name. ;-)

-- 
-Tucker Taft   stt@averstar.com   http://www.averstar.com/~stt/
Technical Director, Distributed IT Solutions  (www.averstar.com/tools)
AverStar (formerly Intermetrics, Inc.)   Burlington, MA  USA




  parent reply	other threads:[~1999-05-12  0:00 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-05-10  0:00 Assertions J & A Richardson
1999-05-10  0:00 ` Assertions Marin David Condic
1999-05-11  0:00   ` Assertions Robert Dewar
1999-05-11  0:00     ` Assertions Nick Roberts
1999-05-11  0:00       ` Assertions Robert Dewar
1999-05-12  0:00         ` Assertions Dale Stanbrough
1999-05-12  0:00           ` Assertions Robert Dewar
1999-05-12  0:00     ` Tucker Taft [this message]
1999-05-12  0:00       ` Assertions Larry Kilgallen
1999-05-12  0:00         ` Assertions Tucker Taft
1999-05-13  0:00         ` Assertions Nick Roberts
1999-05-17  0:00           ` Assertions Dale Stanbrough
1999-05-19  0:00             ` Assertions Nick Roberts
1999-05-22  0:00               ` Assertions Dale Stanbrough
1999-05-22  0:00                 ` Assertions Robert Dewar
1999-05-22  0:00                 ` Assertions Ray Blaak
1999-05-22  0:00                   ` Assertions Robert Dewar
1999-05-23  0:00                     ` Assertions Nick Roberts
1999-05-24  0:00                       ` Assertions Ray Blaak
1999-05-24  0:00                       ` Assertions Dale Stanbrough
1999-05-23  0:00                 ` Assertions Nick Roberts
1999-05-12  0:00       ` Assertions Marin David Condic
1999-05-18  0:00       ` Assertions Richard D Riehle
1999-05-19  0:00         ` Assertions Nick Roberts
1999-05-19  0:00           ` Assertions Richard D Riehle
1999-05-20  0:00             ` Assertions stimuli
1999-05-21  0:00               ` Assertions Richard D Riehle
1999-05-21  0:00                 ` Assertions Robert Dewar
1999-05-20  0:00             ` Assertions Ehud Lamm
1999-05-21  0:00               ` Assertions Robert Dewar
1999-05-21  0:00                 ` Assertions Ehud Lamm
1999-05-21  0:00                   ` Assertions Tucker Taft
1999-05-20  0:00           ` Assertions stimuli
1999-05-12  0:00 ` Assertions Peter Amey
1999-05-12  0:00   ` Assertions Robert Dewar
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox