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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1e5c102037393131 X-Google-Attributes: gid103376,public From: Tucker Taft Subject: Re: Assertions Date: 1999/05/12 Message-ID: <3739CECA.6A49865B@averstar.com>#1/1 X-Deja-AN: 477112305 Content-Transfer-Encoding: 7bit Sender: news@inmet.camb.inmet.com (USENET news) X-Nntp-Posting-Host: houdini.burl.averstar.com References: <3736D243.1EEBF1AB@globalnet.co.uk> <3736F549.E3DDCDEB@pwfl.com> <7h83lc$rd$1@nnrp1.deja.com> Content-Type: text/plain; charset=us-ascii Organization: AverStar (formerly Intermetrics) Burlington, MA USA Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1999-05-12T00:00:00+00:00 List-Id: 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