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,8002154d2966e1a1 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-11-05 21:00:04 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.uchicago.edu!newsswitch.lcs.mit.edu!snoopy.risq.qc.ca!chi1.webusenet.com!rip!news.webusenet.com!prodigy.com!newsmst01.news.prodigy.com!prodigy.com!postmaster.news.prodigy.com!newssvr13.news.prodigy.com.POSTED!17b0e3b3!not-for-mail User-Agent: Microsoft-Outlook-Express-Macintosh-Edition/5.02.2022 Subject: Re: Local vs global variables in ADA From: "R. Tim Coslet" Newsgroups: comp.lang.ada Message-ID: References: <5Ldx9.3695$151.38236@weber.videotron.net> <3DC5D1B7.1060707@acm.org> <3DC6DD54.10200@acm.org> <1fl5uz5.x1tu5v11ap2aeN%claveman@grzorgenplatz.net> Mime-version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit NNTP-Posting-Host: 206.170.5.23 X-Complaints-To: abuse@prodigy.net X-Trace: newssvr13.news.prodigy.com 1036558759 ST000 206.170.5.23 (Tue, 05 Nov 2002 23:59:19 EST) NNTP-Posting-Date: Tue, 05 Nov 2002 23:59:19 EST Organization: Prodigy Internet http://www.prodigy.com X-UserInfo1: SCSGGWWGVZUUCP\YZBCD^VX@WB]^PCPDLXUNNHLHQAVTUZ]CLNTCPFK[WDXDHV[K^FCGJCJLPF_D_NCC@FUG^Q\DINVAXSLIFXYJSSCCALP@PB@\OS@BITWAH\CQZKJMMD^SJA^NXA\GVLSRBD^M_NW_F[YLVTWIGAXAQBOATKBBQRXECDFDMQ\DZFUE@\JM Date: Wed, 06 Nov 2002 04:59:19 GMT Xref: archiver1.google.com comp.lang.ada:30420 Date: 2002-11-06T04:59:19+00:00 List-Id: Just a bit of trivia, but the counter in an Ada "for" loop is NOT a variable. It is defined as a *constant* initialized to successive different values on each iteration of the loop. If it were a variable the program could change the value with the assignment statement or by passing it as an out or in out parameter to a procedure. This is forbidden and will be reported as an error by any validated Ada compiler. -- R. Tim Coslet r_tim_coslet@pacbell.net Technology, n. Domesticated natural phenomena. > From: claveman@grzorgenplatz.net (Charles H. Sampson) > Organization: NetHere Inc. > Newsgroups: comp.lang.ada > Date: Tue, 5 Nov 2002 05:53:55 -0800 > Subject: Re: Local vs global variables in ADA > [...] > > Seriously, here's what I try to do: use the for-loop and while-loop > only when they express the loop's termination condition. In other > words, do not use exit statements within loops of these forms; if a loop > requires an exit statement, then use an "infinite" loop instead. > Unfortunately, my will power is often too weak to overcome the > convenience of the automatically declared counting variable of a > for-loop. I'm much better with while loops. > > Charlie