Article View: comp.std.c
Article #3430Re: Multi-level break and elimination of GOTO
From: Goran Larsson
Date: Fri, 22 Sep 1995 17:26
Date: Fri, 22 Sep 1995 17:26
31 lines
1669 bytes
1669 bytes
In article <43pdut$hoh@galaxy.csc.calpoly.edu> awozniak@galaxy.csc.calpoly.edu (Hey Sister can you spare a hug?) writes:
. . .
> /* something filles in my 2D char array and I want to find the first
> asterix inside it. */
^^^^^^^ :-)
. . .
>It feels to me like what I _really_ want to do is this:
. . .
> break(2);
I would hate to maintain code with that kind of "disasters waiting to
happen". This is many times as bad as a goto - with a goto you can
actually see the destination (the label) and it won't move, with your
disasterous suggestion the destination is invisible and can move around
(by changing the number of nesting levels between the break and the
intended destination. What a nightmare.
>compile time we run into fewer problems than we do if we allow any integer
>expression and evaluate it at run time (although I suppose we could get
>around this with the clever use of jump tables or some such).
...like
break ( i > 5 ? func ( table[i++] ) + 2 : 2 );
This would be perfect for the OCCC! :-) :-) :-)
--
Goran Larsson Phone: +46 13 299588 FAX: +46 13 299022
Approve AB +46 589 12810 +46 589 16901
hoh@approve.se
I was an atheist, until I found out I was God.
Technical Details
Message-ID:
<1995Sep22.172636.26826@lorelei.approve.se>Path:
arc1-ca.pugleaf.net!mn4.swip.net!lorelei!hohReferences:
<43pdut$hoh@galaxy.csc.calpoly.edu>Show Full Headers
Complete Article Headers
Newsgroups: comp.std.c,comp.lang.c Path: arc1-ca.pugleaf.net!mn4.swip.net!lorelei!hoh From: hoh@lorelei.approve.se (Goran Larsson) Subject: Re: Multi-level break and elimination of GOTO Message-ID: <1995Sep22.172636.26826@lorelei.approve.se> Organization: Home of the Hacker of Hackefors References: <43pdut$hoh@galaxy.csc.calpoly.edu> Date: Fri, 22 Sep 1995 17:26:36 GMT