From: "R. Tim Coslet" <R_Tim_Coslet@pacbell.net>
Subject: Re: Local vs global variables in ADA
Date: Wed, 06 Nov 2002 04:59:19 GMT
Date: 2002-11-06T04:59:19+00:00 [thread overview]
Message-ID: <B9EDE0F9.5C46%R_Tim_Coslet@pacbell.net> (raw)
In-Reply-To: 1fl5uz5.x1tu5v11ap2aeN%claveman@grzorgenplatz.net
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
next prev parent reply other threads:[~2002-11-06 4:59 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-11-03 18:17 Local vs global variables in ADA Roger
2002-11-03 19:03 ` Per Sandbergs
2002-11-03 19:31 ` Eric Jacoboni
2002-11-04 1:47 ` Jeffrey Carter
2002-11-04 13:27 ` Wes Groleau
2002-11-04 20:48 ` Jeffrey Carter
2002-11-05 8:43 ` Fraser Wilson
2002-11-05 13:53 ` Charles H. Sampson
2002-11-06 4:59 ` R. Tim Coslet [this message]
2002-11-05 17:28 ` Stephen Leake
2002-11-05 17:38 ` Jean-Pierre Rosen
2002-11-05 19:57 ` Jeffrey Carter
2002-11-06 9:11 ` Jean-Pierre Rosen
2002-11-05 20:26 ` Vinzent Hoefler
2002-11-05 23:14 ` Wes Groleau
2002-11-06 9:16 ` Jean-Pierre Rosen
2002-11-06 13:49 ` Wes Groleau
2002-11-05 22:37 ` Robert A Duff
2002-11-05 23:46 ` Larry Hazel
2002-11-06 2:19 ` Dennis Lee Bieber
2002-11-06 13:45 ` Dan Nagle
2002-11-07 0:30 ` Dennis Lee Bieber
2002-11-06 2:15 ` Dennis Lee Bieber
2002-11-06 7:04 ` Martin Dowie
2002-11-06 14:40 ` john mann
2002-11-07 0:25 ` Dennis Lee Bieber
2002-11-07 14:58 ` Robert A Duff
2002-11-07 15:38 ` Jean-Pierre Rosen
2002-11-08 1:43 ` Jeffrey Carter
2002-11-06 7:18 ` Dale Stanbrough
2002-11-06 15:40 ` Rod Chapman
2002-11-06 17:34 ` Stephen Leake
2002-11-10 1:36 ` loop statements, was " David Thompson
2002-11-05 19:54 ` Jeffrey Carter
2002-11-04 13:47 ` Martin Dowie
-- strict thread matches above, loose matches on Subject: below --
2002-11-05 6:42 Grein, Christoph
2002-11-05 15:59 ` Martin Dowie
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox