Subject: Re: compiler tweak offered
To: Alan Barrett <apb@cequrux.com>
From: Greg A. Woods <woods@weird.com>
List: tech-toolchain
Date: 08/25/2002 13:09:08
[ On Sunday, August 25, 2002 at 09:19:41 (+0200), Alan Barrett wrote: ]
> Subject: Re: compiler tweak offered
>
> On Sat, 24 Aug 2002, der Mouse wrote:
> > It provides named control structure for loops and switches, allowing
> > you to do stuff like
> > 
> >       for "outer" (x=list; x; x=x->link) {
> >               while (...) {
> >                       ...
> >                       if (...) continue "outer";
> 
> If I were designing new features for the C language, I'd probably
> want the loop label to be just like an ordinary label, thus:
> 
>         outer:  for (x=list; x; x=x->link) {
>                     while (...) {
>                         ...
>                         if (...) continue outer;

Ah, yes, that makes more sense to me too, and if I'm not mistaken
there's already prior art for using labels on 'continue' and 'break' (I
just can't remember where at the moment -- ah, yes, Java & JavaScript.)

-- 
								Greg A. Woods

+1 416 218-0098;            <g.a.woods@ieee.org>;           <woods@robohack.ca>
Planix, Inc. <woods@planix.com>; VE3TCP; Secrets of the Weird <woods@weird.com>