TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy


Options: Use Forum View

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

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

Print Reply
"Robert I. Eachus" <[log in to unmask]>
Reply To:
Robert I. Eachus
Fri, 20 Mar 1998 18:38:12 -0500
text/plain (61 lines)
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:

      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 =>
      if Condition
      end if;
    when E => ...

     and of course what we really write in Ada is:
    when D =>
      if Condition
      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...