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-7-bit From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: for S'Image use Func?? Date: Wed, 19 May 2010 01:26:31 -0500 Organization: Jacob Sparre Andersen Message-ID: References: NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: munin.nbi.dk 1274250393 19615 69.95.181.76 (19 May 2010 06:26:33 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Wed, 19 May 2010 06:26:33 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5843 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 Path: g2news2.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!feed.ac-versailles.fr!news.ecp.fr!news.jacob-sparre.dk!pnx.dk!not-for-mail Xref: g2news2.google.com comp.lang.ada:11744 Date: 2010-05-19T01:26:31-05:00 List-Id: "Warren" wrote in message news:Xns9D747B0528E86WarrensBlatherings@188.40.43.245... > Robert A Duff expounded in news:wccd3x7lww8.fsf@shell01.TheWorld.com: > >> "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. ;-) >> >> Also, the other advantage of pragma Assert over an Assert >> procedure is that you can put the pragma in declarative parts >> and package specs. > > What I liked is the added convenience of having the > source module and line number reported, without me > having to code for that. Janus/Ada reports that for all exception raises (as well as a complete traceback of calls), and always has (even back on the Z80 CP/M version in 1981), so there isn't any advantage to the pragma over plain Ada code that raises an exception on failure. The only thing that is even remotely complex that the pragma addresses is putting checks in declarative parts (which is not usually a problem with judious use of blocks). Randy.