Re: "continue/next" for "loop"
From: Robert I. Eachus (rieachus_at_comcast.net)
Date: 11/03/03
- Next message: Alexandre E. Kopilovitch: "Re: Standard Library Interest?"
- Previous message: Larry Kilgallen: "Re: Read Binary File (on Compaq Ada)"
- Maybe in reply to: Lutz Donnerhacke: ""continue/next" for "loop""
- Next in thread: see below: "Re: "continue/next" for "loop""
- Reply: see below: "Re: "continue/next" for "loop""
- Reply: Jeffrey Carter: "Re: "continue/next" for "loop""
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Mon, 03 Nov 2003 11:49:42 -0500
Peter Hermann wrote:
> assuming the number of keywords 69 constant,
> we could imagine these:
I actually think we are going to get one or two new reserved words in
Ada 200X.
> goto loop [loopid];
>
> or
>
> exit [loopid] not [when ...];
But I think in the case of loops, there are clearly two specialized
forms of goto that should be considered:
goto exit; -- exit innermost enclosing loop.
exit loop; -- alternative syntax. ;-)
and
goto end; -- skip to start of next loop iteration.
goto loop;
goto begin;
For the first case, I think that "exit loop" is probably the preferred
notation. It really is a goto in disguise, but one that need not be
prohibited by those coding standards that prohibit gotos. ;-)
For the second, I am not sure whether "goto loop" or "goto end" is
better. In either case it really is a goto. Other possibilities
include "goto for" and "goto while," but this construct will IMHO often
be used in loops with no for or while clauses.
Back to the earlier discussion about "with and use," I think that "exit
loop" and "goto loop," if added to the language would clearly enhance
readability and maintainability.
-- Robert I. Eachus 100% Ada, no bugs--the only way to create software.
- Next message: Alexandre E. Kopilovitch: "Re: Standard Library Interest?"
- Previous message: Larry Kilgallen: "Re: Read Binary File (on Compaq Ada)"
- Maybe in reply to: Lutz Donnerhacke: ""continue/next" for "loop""
- Next in thread: see below: "Re: "continue/next" for "loop""
- Reply: see below: "Re: "continue/next" for "loop""
- Reply: Jeffrey Carter: "Re: "continue/next" for "loop""
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|