Article View: comp.std.c
Article #3493Re: Multi-level break and elimination of GOTO
From: Andrew Dunbar
Date: Wed, 15 Nov 1995 04:25
Date: Wed, 15 Nov 1995 04:25
38 lines
1826 bytes
1826 bytes
Donn Terry (donn@fc.hp.com) wrote:
: 4) On the issue of where to place the label: label compound
: statements. Not for or while loops, but simply the compound
: statement. It should parse in all cases, but I havn't tested that.
: This then allows breaks/continues out of non-iterative statements.
: (Or switches.)
:
: (I'm not sure what continue out of a switch or non-iterative
: statement means, but it's no worse than currently where break and
: continue use different scopes when a switch is enclosed in a for.
: (At least using labeled blocks, it would either have a meaning or be
: an error, rather that silently doing something that isn't all that
: intuitive.))
As you say:
block1: {
block2: {
break block1;
}
}
would have a meaning whereas:
block1: {
block2: {
continue block1;
}
}
would not (unless enclosed inside a larger do, for, or while loop)
Ignoring continue, might this not lead to abuse of break to jump out
of any block, much as return is overused by some today? It think it
could start a new wave of 'structured' spaghetti code :)
Andrew Dunbar
GPSoftware
Technical Details
Message-ID:
<48bq4l$lmf@news.mel.aone.net.au>Path:
arc1-ca.pugleaf.net!news.mel.aone.net.au!not-for-mailReferences:
<43pdut$hoh@galaxy.csc.calpoly.edu> <DF8FE3.97H@news.cern.ch> <47s7l0$r18@news.mel.aone.net.au> <815950407snz@genesis.demon.co.uk> <1995Nov13.132225.12081@friend.kastle.com> <487u4k$2eo@sargas.omicron.se> <488b3v$cvr@fcnews.fc.hp.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!news.mel.aone.net.au!not-for-mail From: andrewd@agnus.livewire.com.au (Andrew Dunbar) Newsgroups: comp.std.c,comp.lang.c Subject: Re: Multi-level break and elimination of GOTO Date: 15 Nov 1995 04:25:57 GMT Organization: Livewire Communications Message-ID: <48bq4l$lmf@news.mel.aone.net.au> References: <43pdut$hoh@galaxy.csc.calpoly.edu> <DF8FE3.97H@news.cern.ch> <47s7l0$r18@news.mel.aone.net.au> <815950407snz@genesis.demon.co.uk> <1995Nov13.132225.12081@friend.kastle.com> <487u4k$2eo@sargas.omicron.se> <488b3v$cvr@fcnews.fc.hp.com> NNTP-Posting-Host: agnus.livewire.com.au X-Newsreader: TIN [UNIX 1.3 950515BETA PL0]