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,c689b55786a9f2bd X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news1.google.com!news.glorb.com!news2.glorb.com!news.mv.net!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: for S'Image use Func?? Date: Fri, 07 May 2010 16:19:14 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: pcls6.std.com 1273263539 7700 192.74.137.71 (7 May 2010 20:18:59 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Fri, 7 May 2010 20:18:59 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:Kv2uQ4ecZ+tSAyjpw4vaibH0qsA= Xref: g2news2.google.com comp.lang.ada:11387 Date: 2010-05-07T16:19:14-04:00 List-Id: "Yannick Duch�ne (Hibou57)" writes: > Le Fri, 07 May 2010 14:27:35 +0200, Robert A Duff > a �crit: > >> "Randy Brukardt" writes: >> >>> I actually don't buy the need for the Assert pragma in the first >>> place: such >>> checks are rarely expensive and thus should simply be part of the code >>> always. >> >> If they're not expensive, then you're not using it enough. ;-) > Hihi, nice > >> Also, the other advantage of pragma Assert over an Assert >> procedure is that you can put the pragma in declarative parts >> and package specs. > That's what I like to do too : define Assert pragmas in package spec, > ... Then you will probably like some of the new proposals for Ada 2012 -- take a look at preconditions, postconditions, subtype predicates, and type invariants. I am particularly fond of subtype predicates, but I'm afraid many ARG members do not (yet?!) agree with me on that. GNAT's pragmas Compile_Time_Error and Compile_Time_Warning can also be useful in this general area. - Bob