TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy

TEAM-ADA@LISTSERV.ACM.ORG

Options: Use Forum View

Use Proportional Font
Show Text Part by Default
Show All Mail Headers

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

Print Reply
Subject:
From:
Randy Brukardt <[log in to unmask]>
Reply To:
Randy Brukardt <[log in to unmask]>
Date:
Thu, 19 Mar 1998 17:30:08 -0600
Content-Type:
text/plain
Parts/Attachments:
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
alternatives,
>such as a goto to a null last statement or a loop within a loop, I
conclude
>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.)

                                Randy.

ATOM RSS1 RSS2