comp.lang.ada
 help / color / mirror / Atom feed
* Is there an ADA analogue to the C++ continue statement?
@ 1997-09-17  0:00 Heath, Terry D.
  1997-09-18  0:00 ` Robert Dewar
  1997-09-18  0:00 ` Pascal Obry
  0 siblings, 2 replies; 30+ messages in thread
From: Heath, Terry D. @ 1997-09-17  0:00 UTC (permalink / raw)



Almost all of my programming is done in C++, and I have never
programmed in Ada (my loss!), although I have seen some examples of
Ada syntax.

I am curious, does Ada have a statement analogous to the C++ continue
statement (see immediately below) ?

EXAMPLE OF C++ CONTINUE STATEMENT:

         while (condition-1)
               {
                     statement-1;

                     if (condition-2)
                         continue;

                     statement-3;
                }

In the above, if condition-2 evaluates to be true, then flow of
control is immediately transferred back to the top of the while loop
(where condition-1 is then tested for, in order to determine whether
iteration of the while loop is to continue).

Note, although the word 'continue' might suggest a NOP type
instruction (NOP = No OPeration ... just continue forward!), that is
not what occurs in C++ (instead, a jump occurs as described in the
previous sentence)  ...  they should have chosen a better name for
the statement !

That is, the C++ continue statement has the opposite effect to the
Ada exit statement (the former transfers flow of control to the start
of the loop construct, whereas the latter transfers control to the
end of the loop construct).

Certainly, the pattern of execution defined by the pseudo-code above
can be implemented by way of traditional structured programming
techniques without recourse to a 'continue' type statement such as
that above.  Nonetheless, I believe the flow of control defined by
the pseudo-code above to be consistent with all widely accepted
structured programming principles (after all, it is just the reverse
concept of that underpinning the Ada exit statement).

So, does Ada have a statement analogous to the C++ continue statement
?

Thanks in advance,
Terry. 





^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~1997-10-07  0:00 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-09-17  0:00 Is there an ADA analogue to the C++ continue statement? Heath, Terry D.
1997-09-18  0:00 ` Robert Dewar
1997-09-18  0:00 ` Pascal Obry
1997-09-18  0:00   ` Robert A Duff
1997-09-18  0:00   ` Samuel Tardieu
1997-09-19  0:00   ` Robert Dewar
     [not found]     ` <3422F037.41CA@lmco.com>
1997-09-20  0:00       ` dan13
1997-09-21  0:00         ` Robert Dewar
     [not found]           ` <3426B51E.7296@lmco.com>
1997-09-22  0:00             ` Coding Standards & GOTO Matthew Heaney
1997-09-23  0:00               ` Mark A Biggar
1997-09-24  0:00                 ` W. Wesley Groleau x4923
1997-09-24  0:00                 ` Shmuel (Seymour J.) Metz
1997-09-24  0:00               ` Aaron Quantz
1997-09-26  0:00               ` Charles H. Sampson
1997-09-23  0:00             ` Charles Rose
1997-09-24  0:00               ` Matthew Heaney
1997-09-25  0:00                 ` Shmuel (Seymour J.) Metz
1997-09-23  0:00             ` Coding Standards W. Wesley Groleau x4923
1997-09-22  0:00         ` Is there an ADA analogue to the C++ continue statement? Richard D Riehle
1997-09-23  0:00         ` GOTO considered Satanic (was: Is there an ADA analogue to the C++ continue statement?) Adam Beneschan
1997-09-24  0:00           ` Brian Rogoff
1997-09-25  0:00             ` Larry Kilgallen
1997-09-26  0:00             ` Matthew Heaney
1997-09-26  0:00               ` Brian Rogoff
1997-10-07  0:00               ` Robert I. Eachus
1997-09-24  0:00           ` W. Wesley Groleau x4923
1997-09-25  0:00           ` Alan Brain
1997-09-25  0:00             ` Shmuel (Seymour J.) Metz
1997-09-22  0:00     ` Is there an ADA analogue to the C++ continue statement? Richard A. O'Keefe
1997-09-29  0:00     ` John G. Volan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox