Oh nooo! (gotos)

Dave Jones djones at megatest.UUCP
Wed Sep 13 04:04:04 AEST 1989


>From article <1989Sep12.014534.1503 at twwells.com), by bill at twwells.com (T. William Wells):
) In article <7887 at goofy.megatest.UUCP) djones at megatest.UUCP (Dave Jones) writes:
) : From article <1989Sep8.070123.4416 at twwells.com), by bill at twwells.com (T. William Wells):
)))) while(rule = (Rule*)Queue_iter_next(&rule_iter)) {
))))   while(rsym = (Symbol*)Queue_iter_next(&rsym_iter)) {
))))    switch (derives(rsym)) {
))))    case derives_nothing:
))))      goto next_rule;
))))    ....
))))    }
))))   }
)))) next_rule: continue;
)))) }
)))
)))     while(rule = (Rule*)Queue_iter_next(&rule_iter)) {
)))             while(rsym = (Symbol*)Queue_iter_next(&rsym_iter)) {
)))                     switch (derives(rsym)) {
)))                     case derives_nothing:
)))                             break;
)))                     .... (cases that want to loop use continue)
)))                     }
)))                     break;
)))             }
)))     }
)))
) :
) :                              you removed a goto but added a
) : fatal bug.  I would prefer the goto.
) 
) Well yeah, so would I. But what is the bug? I've just reread the code
) and don't see where I've broken it. I'm prepared to be red-faced
) because this has go to be something really obvious, but what?
) 

DON'T PANIC.

Your face is going to be just fine. But it's lucky for me that I don't blush.
You didn't misread it. I did. In fact, I read it half a dozen times before I saw
the "break" at the end of the while-loop.

Boy, that's wierd.

No offense, but you won't catch me using this device. Different strokes,
I guess.

Maybe we should start a debate: "Breaks at end of while-loops... considered
harmful?"  Oh Nooooooooooooooo!!!



More information about the Comp.lang.c mailing list