Article View: comp.std.c
Article #3916Re: How to eliminate GOTO?
From: halasz
Date: Mon, 04 Sep 1995 16:15
Date: Mon, 04 Sep 1995 16:15
22 lines
1160 bytes
1160 bytes
In article <42bjpc$lum@yage.tembel.org>, shields@tembel.org (Michael Shields) writes:
> But that would be the same as goto, plus a suffix.
"suffix"?
> The potential for abuse is obvious; can you give an example
> where it would make code much clearer?
(the strange new token is onlie for distinction from "goto"-label):
search:: while (1) {
...
while (1) {
...
break search;
}
}
The syntactic distinction makes "goto" not work for this label. Furthermore,
this label is known onlie within the loop, and use of it on another loop is
valid. Therefore, one knows where "break"s and "continue"s that refer to
this label can be.
Another form was suggested:
while search: (1) { ... }
. This is good, except for "do ... while (...);".
Technical Details
Message-ID:
<42f8n4$eq1@caip.rutgers.edu>Path:
arc1-ca.pugleaf.net!caip.rutgers.edu!not-for-mailReferences:
<41cke4$gtd@sparcserver.lrz-muenchen.de> <41ni1c$ft6@news1.wolfe.net> <42bjpc$lum@yage.tembel.org>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!caip.rutgers.edu!not-for-mail From: halasz@caip.rutgers.edu Newsgroups: comp.std.c Subject: Re: How to eliminate GOTO? Date: 4 Sep 1995 12:15:32 -0400 Organization: Rutgers University Message-ID: <42f8n4$eq1@caip.rutgers.edu> References: <41cke4$gtd@sparcserver.lrz-muenchen.de> <41ni1c$ft6@news1.wolfe.net> <42bjpc$lum@yage.tembel.org> NNTP-Posting-Host: caip.rutgers.edu