Oh nooo! (gotos)
Dave Jones
djones at megatest.UUCP
Sun Sep 10 15:51:20 AEST 1989
>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;
) :
) : }
)
) Look Ma, no goto!
)
) 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;
) }
) }
)
Your mother should know that you removed a goto but added a
fatal bug. I would prefer the goto. Ask your Ma.
More information about the Comp.lang.c
mailing list