Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 exptools 1/6/84; site ihuxi.UUCP
Path: utzoo!watmath!clyde!burl!ulysses!mhuxr!ihnp4!ihuxi!trough
From: trough@ihuxi.UUCP (Chris Scussel)
Newsgroups: net.lang.c
Subject: break != goto
Message-ID: <1143@ihuxi.UUCP>
Date: Thu, 10-Jan-85 12:01:05 EST
Article-I.D.: ihuxi.1143
Posted: Thu Jan 10 12:01:05 1985
Date-Received: Sat, 12-Jan-85 00:48:22 EST
Organization: AT&T Bell Labs, Naperville, IL
Lines: 36
There seems to be some confusion on the suggested "break " construct.
I believe the suggestion is:
label: for ( ... )
{
...
break label ;
...
}
Some folks apparently interpreted the suggestion as meaning
for ( ... )
{
...
break label ;
...
}
label: ...
which does differ from a vanilla goto, but not by much.
I believe that the first interpretion is both nicely structured and useful.
The "break" is associated with the construct it breaks by the label,
so the suggestion is relatively robust in the face of code changes,
unlike "break ", "goto ", and the alternate interpretation
of "break ".
I must admit that when I first heard of this a couple of years
back I also misinterpreted it to be not much more than a goto. When
it was explained to me what was really meant I became an instant convert,
and have liked it ever since. (Just for fun, I added it to a C interpreter
I had written. It was trivial.)
Chris Scussel
AT&T Bell Labs
ihnp4!ihuxi!trough