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,FREEMAIL_FROM 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,UTF8 Path: g2news2.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!usenet-fr.net!gegeweb.org!aioe.org!not-for-mail From: =?utf-8?Q?Yannick_Duch=C3=AAne_=28Hibou57?= =?utf-8?Q?=29?= Newsgroups: comp.lang.ada Subject: Re: for S'Image use Func?? Date: Fri, 07 May 2010 17:19:14 +0200 Organization: Ada At Home Message-ID: References: NNTP-Posting-Host: USAyO1MNnUeFapd/hHloTg.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: Quoted-Printable X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 User-Agent: Opera Mail/10.53 (Win32) Xref: g2news2.google.com comp.lang.ada:11372 Date: 2010-05-07T17:19:14+02:00 List-Id: Le Fri, 07 May 2010 14:27:35 +0200, Robert A Duff = a =C3=A9crit: > "Randy Brukardt" writes: > >> I actually don't buy the need for the Assert pragma in the first plac= e: = >> such >> checks are rarely expensive and thus should simply be part of the cod= e >> 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, so= = that it can be used to derive some property in the implementation or in = = some other part of the specification. This express coherence between som= e = elements or other things (there are things which cannot be expressed wit= h = type properties), on which you can rely to say =E2=80=9Cthis and this, i= s valid, = because of that (the Assert pragma somewhere)=E2=80=9D. I find it useful= to safely = drop some runtime check whenever something must be fast or is looped = thousands of times, or even simply to be sure something is OK (no need f= or = execution speed requirements to wish that). If the assumptions are wrong= = and so what is derived from these too, well, the package simply raise an= = exception at elaboration instead of behaving oddly. -- = No-no, this isn't an oops ...or I hope (TM) - Don't blame me... I'm just= = not lucky