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=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,cd1591f986baca62 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-03-19 13:03:39 PST Path: supernews.google.com!sn-xit-02!supernews.com!news.gv.tsc.tdk.com!falcon.america.net!sunqbc.risq.qc.ca!feeder.qis.net!feed2.onemain.com!feed1.onemain.com!newsfeed2.earthlink.net!newsfeed.earthlink.net!newsmaster1.prod.itd.earthlink.net!newsread2.prod.itd.earthlink.net.POSTED!not-for-mail Message-ID: <3AB673D0.C3813A70@earthlink.net> From: "Robert I. Eachus" Organization: Eachus Associates X-Mailer: Mozilla 4.73 [en]C-19990120M (Win98; U) X-Accept-Language: en,pdf MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: AdaYY; Assertions? References: <3AAA9B7A.36B601F0@ix.netcom.com> <3AAFA79A.66F86B99@ix.netcom.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Mon, 19 Mar 2001 21:02:44 GMT NNTP-Posting-Host: 24.128.71.83 X-Complaints-To: abuse@earthlink.net X-Trace: newsread2.prod.itd.earthlink.net 985035764 24.128.71.83 (Mon, 19 Mar 2001 13:02:44 PST) NNTP-Posting-Date: Mon, 19 Mar 2001 13:02:44 PST Xref: supernews.google.com comp.lang.ada:5872 Date: 2001-03-19T21:02:44+00:00 List-Id: Robert A Duff wrote: > The "obvious" thing to do with a precondition failure in the Ada context > is to raise an exception. I have thought a lot about how to move this > checking to compile time -- it's not easy. The same comments apply to > the run-time checks that already exist in Ada. And for the same reason. Requiring an assertion to be checked and raise an exception is not problematical, and compilers can and should check as many as possible at compile time, with warnings. But in the general case, it is not only not possible to check all interesting post conditions at compile time, it should be trivially obvious that you can't always statically determine even that the post condition will be reached. (And not just in the case of the halting problem. ;-) So I certainly favor allowing more general conditions in assertions, rather than trying to define a compile time checkable set. And I think that current compilers do a pretty good job. For example, if you need to assert that a number is even, "pramga Assert(N mod 2 = 0);"