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-Language: ENGLISH,ASCII X-Google-Thread: 103376,7d1a6bfc6489c17b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2000-09-06 02:48:01 PST Message-ID: <39B6114B.2929FA58@amsjv.com> Date: Wed, 06 Sep 2000 10:41:31 +0100 From: Philip Anderson Organization: Alenia Marconi Systems ISD X-Mailer: Mozilla 4.7 [en] (WinNT; I) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: exiting a bloc References: <39B15EA8.88DB58AB@netcourrier.com> <8orprn$b46$1@nnrp1.deja.com> <39B532CB.73D359F8@ix.netcom.com> <39B5A8B0.56D674C6@telepath.com> Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit NNTP-Posting-Host: 141.196.71.137 X-Trace: 6 Sep 2000 10:37:12 GMT, 141.196.71.137 Path: supernews.google.com!sn-xit-02!sn-east!supernews.com!news-feed.riddles.org.uk!newsfeed.direct.ca!look.ca!btnet-peer0!btnet!newreader.ukcore.bt.net!pull.gecm.com!141.196.71.137 Xref: supernews.google.com comp.lang.ada:518 Date: 2000-09-06T10:41:31+01:00 List-Id: Ted Dennison wrote: > > I know I pretty much follow that rule myself. But I'm not sure I'd like to > see it elevated to Law. I do occasionaly like to use "declare" for sizing > arrays (particularly strings) dynamicly on the stack. I think I've also used > them in the "accept" alternatives of server tasks or in branches of large > command-processing case statements to declare local variables that are > unique to that alternative. > > About the only other reason I ever use a declare is to declare local > variables that are used in the exception code of a block's exception > handler. It'd be a bit excessive to create a new routine just because the > exception handler needs a variable. It makes sense to limit the variable's > scope to the block, since that's the only place its used and the block is > already there. I'd agree with that in general, but it's a not unreasonable restriction to impose if restrictions are being imposed. Declare blocks are excluded in SPARK, and it makes sense there; most of the situations where you and I might use it are not applicable in SPARK anyway - no dynamic arrays, tasks or exceptions. Branches of case statements could arise, but it would seem more readable to call a procedure if one is that complicated. -- hwyl/cheers, Philip Anderson Alenia Marconi Systems Cwmbr�n, Cymru/Wales