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: 103376,fc52c633190162e0 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!tiscali!newsfeed1.ip.tiscali.net!fi.sn.net!newsfeed2.fi.sn.net!news.song.fi!not-for-mail Date: Wed, 21 Mar 2007 22:43:58 +0200 From: Niklas Holsti User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20060628 Debian/1.7.8-1sarge7.1 X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Use of declare blocks References: <1172144043.746296.44680@m58g2000cwm.googlegroups.com> <1172161751.573558.24140@h3g2000cwc.googlegroups.com> <546qkhF1tr7dtU1@mid.individual.net> <5ZULh.48$YL5.40@newssvr29.news.prodigy.net> <4eeMh.16400$bb1.2557@newssvr17.news.prodigy.net> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <460198f2$0$24601$39db0f71@news.song.fi> Organization: TDC Song Internet Services NNTP-Posting-Host: laku61.adsl.netsonic.fi X-Trace: 1174509810 news.song.fi 24601 81.17.205.61:32916 X-Complaints-To: abuse@song.fi Xref: g2news1.google.com comp.lang.ada:14581 Date: 2007-03-21T22:43:58+02:00 List-Id: Randy Brukardt wrote: > I use declare blocks extensively to reduce the scope of temporary variables > in subprograms. They're especially important when the object exists just to > take an unused out parameter, because they greatly reduce the need to come > up with names for the objects. I often have code like: > > declare > Junk : Index; > begin > Insert_Something (..., Result => Junk); > end; > > where the result isn't needed by the following code. How about a language extension to omit unused out parameters, for example Insert_Something (..., Result => <>); Perhaps even allowing declaration of optional out parameters, as in procedure Insert_Something (..., Result : out Index := <>); and then a call of Insert_Something could omit Result entirely. -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .