Mime-Version:
1.0
Date:
Fri, 20 Mar 1998 18:38:12 -0500
Content-Type:
text/plain; charset="us-ascii"
|
At 05:51 PM 3/19/98 -0500, Mike Kamrad wrote:
> 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?
It is so far down the list of syntactic sugar that it got lost. The
typical continue use in C looks in Ada like:
loop
case X is
when A =>...
end case;
end loop;
A change to the language to permit the loop and case statement to be
more closely bound would have been nice, in fact I sometimes write:
loop case X is
...
end case; end loop;
And I'd do it more often if I could write that last line as:
end loop case;
But I'm not about to request THAT language extension. In Ada continue
semantics only occurs when you need to prematurely leave the logic for a
particular choice, and want to stay in the processing loop:
...
when D =>
Do_Some_Processing;
if Condition
then
Error_Message;
continue;
end if;
More_Processing;
when E => ...
and of course what we really write in Ada is:
...
when D =>
Do_Some_Processing;
if Condition
then
Error_Message;
else
More_Processing;
end if;
when E => ...
(Or possibly "if not Condition" but I like to put the (shorter)error
cases first.) In any case, I have yet to use a goto or even want a
continue in such code.
Robert I. Eachus
with Standard_Disclaimer;
use Standard_Disclaimer;
function Message (Text: in Clever_Ideas) return Better_Ideas is...
|
|
|