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!news2.google.com!news.glorb.com!news.mv.net!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Ada.Execution_Time Date: Mon, 20 Dec 2010 22:23:12 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <4d05e737$0$6980$9b4e6d93@newsspool4.arcor-online.net> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls6.std.com 1292901792 12974 192.74.137.71 (21 Dec 2010 03:23:12 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Tue, 21 Dec 2010 03:23:12 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:xbilKH5TRQtHSMewpEQb45m/5cI= Xref: g2news2.google.com comp.lang.ada:17061 Date: 2010-12-20T22:23:12-05:00 List-Id: Keith Thompson writes: > So add an assert operator that always yields True: > > declare > Dummy: constant Boolean := assert some_expression; -- assert operator > begin > assert some_other_expression; -- assert statement > end; If asserts had their own syntax, we could allow them wherever we like -- "assert blah;" could be both a statement and a declarative_item. I really don't like having to declare dummy booleans. It gets even more annoying when you have several. What are you going to call them? Dummy_1, Dummy_2, and Dummy_3? And then after some maintenance, Dummy_1, Dummy_2_and_a_half, and Dummy_3? Seems like an awful lot of noise -- assertions should be easy! (Of course, you might remember me complaining that the declare/begin/end is just noise, too.) Anyway, the strong syntactic separation between declarations and statements makes no sense in a language where declarations are executable code. I think it's just wrong-headed thinking inherited from Pascal. > Though the use of "Assert" as an identifier in existing code is > certainly an issue. I've certainly written procedures called Assert that do what you might expect. This was quite common before pragma Assert existed. - Bob