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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,96ae138aab3beb03 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-05-31 06:38:36 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!colt.net!news.tele.dk!not-for-mail Message-ID: <3CF77CDA.3090805@yahoo.com> Date: Fri, 31 May 2002 15:38:34 +0200 From: David Rasmussen User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9) Gecko/20020412 Debian/0.9.9-6 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Localized Variable Declaration References: <3CF77998.9040806@yahoo.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Organization: TDC Internet NNTP-Posting-Host: 195.215.62.2 X-Trace: 1022852315 dtext.news.tele.dk 96090 195.215.62.2 X-Complaints-To: abuse@post.tele.dk Xref: archiver1.google.com comp.lang.ada:25079 Date: 2002-05-31T15:38:34+02:00 List-Id: > > > use 'declare' e.g. > > procedure Blah is > begin -- Blah > if Some_Function then > declare > Local_Variable : Integer; -- only visible within the block > begin > -- Do something with Local_Variable > end; > else > end if; > end Blah; > > Oh sure, but that is pretty tedious, compared to just a one line variable declation. The point is, to be a bit extreme, that centralized variable declations (e.g. at the "beginning" of the function) as done in C and Pascal, are evil. Variables should be declared close to where they are needed, IMO. /David