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-Thread: a07f3367d7,cae92f92d6a1d4b1 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!news.in2p3.fr!in2p3.fr!news.ecp.fr!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Ada.Execution_Time Date: Thu, 16 Dec 2010 18:44:35 -0600 Organization: Jacob Sparre Andersen Message-ID: References: <4d05e737$0$6980$9b4e6d93@newsspool4.arcor-online.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1292546678 28577 69.95.181.76 (17 Dec 2010 00:44:38 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Fri, 17 Dec 2010 00:44:38 +0000 (UTC) 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.5931 Xref: g2news2.google.com comp.lang.ada:16967 Date: 2010-12-16T18:44:35-06:00 List-Id: "Adam Beneschan" wrote in message news:dfcf048b-bb6e-4993-b62a-9147bad3a6ff@j32g2000prh.googlegroups.com... On Dec 15, 2:52 pm, Keith Thompson wrote: ... >> So, um, why is Assert a pragma rather than a statement? >> >> if Debug_Mode then >> assert Is_Good(X); >> end if; ... >Somebody on the ARG might have a more authoritative answer. My >reading of AI95-286 is that a number of Ada compilers had already >implemented the Assert pragma and there was a lot of code using it. >Of course, those compilers couldn't have added "assert" as a statement >on their own, but adding an implementation-defined pragma is OK. That's one reason. The other is that you can't put a statement into a declarative part (well, you can, but you need to use a helper generic and a helper procedure, along with an instantiation, which is insane -- although it is not that unusual to see that done in a program). A lot of asserts fit most naturally into the declarative part (precondition ones, for instance, although those will be better defined separately in Ada 2012). Randy.