Article View: comp.std.c
Article #3467Re: Multi-level break and elimination of GOTO
From: Lawrence Kirby
Date: Thu, 09 Nov 1995 20:53
Date: Thu, 09 Nov 1995 20:53
41 lines
1442 bytes
1442 bytes
In article <47s7l0$r18@news.mel.aone.net.au>
andrewd@agnus.livewire.com.au "Andrew Dunbar" writes:
>: Andrew Dunbar (andrewd@agnus.livewire.com.au) wrote:
>: :
>: : Has anyone thought of the possibility of 'named' loops?
>: :
>: : for outer (x = 0; x < MAXX; x++)
>: : {
>: : for inner (y = 0; y < MAXY; y++)
>: : {
>: : if (map[y][x] == '*')
>: : break (outer);
>: : }
>: : }
>do
>{
> while inner (exp1)
> {
> if (exp2)
> break outer;
> }
>} while outer;
>
>Not as pretty is it? But then again do loops never were as nice as the
>others.
Writing it as:
do outer
{
} while ()
seems to be most consistent with the other constructs.
--
-----------------------------------------
Lawrence Kirby | fred@genesis.demon.co.uk
Wilts, England | 70734.126@compuserve.com
-----------------------------------------
Technical Details
Message-ID:
<815950407snz@genesis.demon.co.uk>Path:
arc1-ca.pugleaf.net!mail2news.demon.co.uk!genesis.demon.co.ukReferences:
<43pdut$hoh@galaxy.csc.calpoly.edu> <DF8FE3.97H@news.cern.ch> <47s7l0$r18@news.mel.aone.net.au>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!mail2news.demon.co.uk!genesis.demon.co.uk From: Lawrence Kirby <fred@genesis.demon.co.uk> Newsgroups: comp.std.c,comp.lang.c Subject: Re: Multi-level break and elimination of GOTO Date: Thu, 09 Nov 95 20:53:27 GMT Organization: none Message-ID: <815950407snz@genesis.demon.co.uk> References: <43pdut$hoh@galaxy.csc.calpoly.edu> <DF8FE3.97H@news.cern.ch> <47s7l0$r18@news.mel.aone.net.au> Reply-To: fred@genesis.demon.co.uk X-NNTP-Posting-Host: genesis.demon.co.uk X-Newsreader: Demon Internet Simple News v1.27