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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,cae92f92d6a1d4b1 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!feeder.news-service.com!newsfeed.straub-nv.de!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Warren Newsgroups: comp.lang.ada Subject: Re: Ada.Execution_Time Date: Fri, 17 Dec 2010 17:54:39 +0000 (UTC) Organization: A noiseless patient Spider Message-ID: References: <4d05e737$0$6980$9b4e6d93@newsspool4.arcor-online.net> Injection-Date: Fri, 17 Dec 2010 17:54:39 +0000 (UTC) Injection-Info: mx01.eternal-september.org; posting-host="9f8M0iN5t54V+4DF/iqO8g"; logging-data="9388"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19p9zszhu4I2luLiV+iwB980pK0LTFYT7E=" User-Agent: Xnews/5.04.25 X-Face: &6@]C2>ZS=NM|HE-^zWuryN#Z/2_.s9E|G&~DRi|sav9{E}XQJb*\_>=a5"q]\%A;5}LKP][1mA{gZ,Q!j Cancel-Lock: sha1:d6ZXWSTnkfnQ1EsqrG7nKzNQnWE= Xref: g2news2.google.com comp.lang.ada:16982 Date: 2010-12-17T17:54:39+00:00 List-Id: Randy Brukardt expounded in news:ieebpl$rt1$1@munin.nbi.dk: > "Adam Beneschan" wrote in message > news:dfcf048b-bb6e-4993-b62a-9147bad3a6ff@j32g2000prh.google > groups.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. I've never even thought to try that. I'll have to remember that. Warren