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-7-bit X-Google-Thread: 103376,8b8f4ad9d302b143 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-06-05 11:21:06 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!hammer.uoregon.edu!skates!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: ada loops Date: 05 Jun 2003 14:15:32 -0400 Organization: NASA Goddard Space Flight Center (skates.gsfc.nasa.gov) Message-ID: References: <9aktdvc3gcnidr89ipkamofj8mrc7n92jo@4ax.com> NNTP-Posting-Host: anarres.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: skates.gsfc.nasa.gov 1054837905 22923 128.183.235.92 (5 Jun 2003 18:31:45 GMT) X-Complaints-To: usenet@news.gsfc.nasa.gov NNTP-Posting-Date: 5 Jun 2003 18:31:45 GMT User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 Xref: archiver1.google.com comp.lang.ada:38723 Date: 2003-06-05T18:31:45+00:00 List-Id: Dave Thompson writes: > On 30 May 2003 13:25:31 -0400, Stephen Leake > wrote: > [for variable local to loop] > > I don't remember how Pascal did this; I suspect the loop variable was > > not a new declaration. In standard C++, the loop variable is a new > > declaration (as in Ada), but in early versions of C++, it wasn't. > > > Not exactly. In C++ you have an explicit choice: > > 1) if you write e.g. for( i = 0; i < 10; i++ ) ... it uses an existing > variable (which must be) already available (declared). > > 2) if you write e.g. for( int i = 0; i < 10; i++ ) ... it creates a > new variable. Right, sorry. I forgot the details. Fortunately, I'm not writing much C++ code these days :). -- -- Stephe