Article View: comp.std.c
Article #3473Re: Multi-level break and elimination of GOTO
From: Elion
Date: Sat, 11 Nov 1995 20:24
Date: Sat, 11 Nov 1995 20:24
26 lines
1195 bytes
1195 bytes
In article <47eb7k$ckb@news.mel.aone.net.au>, andrewd@agnus.livewire.com.au
says...
>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);
> }
>}
>
Yep, PERL for instance has named blocks and you can use constructs like
next [BLOCK_NAME] ( continue in C )
last [BLOCK_NAME] ( break in C )
and, I'm not quite sure about this one since I've never used it,
redo [BLOCK_NAME]
BLOCK_NAME is optional and if omited the statement applies to the current
block.
Personally, I like this implementation a great deal
elion
Technical Details
Message-ID:
<4830pl$ce@boris.eden.com>Path:
arc1-ca.pugleaf.net!news.eden.com!usenetReferences:
<43pdut$hoh@galaxy.csc.calpoly.edu> <DF8FE3.97H@news.cern.ch> <47eb7k$ckb@news.mel.aone.net.au>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!news.eden.com!usenet From: elion@eden.com (Elion) Newsgroups: comp.std.c,comp.lang.c Subject: Re: Multi-level break and elimination of GOTO Date: 11 Nov 1995 20:24:21 GMT Organization: Adhesive Media, Inc. Message-ID: <4830pl$ce@boris.eden.com> References: <43pdut$hoh@galaxy.csc.calpoly.edu> <DF8FE3.97H@news.cern.ch> <47eb7k$ckb@news.mel.aone.net.au> NNTP-Posting-Host: net-1-167.austin.eden.com Mime-Version: 1.0 Content-Type: Text/Plain; charset=US-ASCII X-Newsreader: WinVN 0.99.6