TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy


Options: Use Forum View

Use Monospaced Font
Show Text Part by Default
Condense Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
"Team Ada: Ada Advocacy Issues (83 & 95)" <[log in to unmask]>
Randy Brukardt <[log in to unmask]>
Thu, 19 Mar 1998 17:30:08 -0600
Randy Brukardt <[log in to unmask]>
text/plain (24 lines)
>One of the engineers asked me if there was an equivalent to the continue
>statement in C for loop continuation.  Well, after looking at
>such as a goto to a null last statement or a loop within a loop, I
>there isn't anything as convenient as the continue.  Does anyone with a
>Rationale for Ada83 (mine's packed away) or a good memory tell me why
>continue wasn't included in the language?

I don't know the answer, but I've found that the Goto works just fine.  The
only problem is for organizations that don't allow Gotos.

>While we're in the same general area, why wasn't the exit statement
>permitted to exit a block statement?

Having spent a lot of effort to get this to work, I can assure that there
is no such limitation in Ada 83 or in Ada 95.  In Ada 95, particularly, it
is messy because of finalization and exception issues.  In any case, the
rule is that you can't Exit out of a body, but a block statement isn't a
body.  (And I'd hate to be wrong here, because I use this occasionally, as
I like to use blocks to limit the scope of temporary variables.)