A long, long time ago, I was debugging a Turbo C program:
status = read_a_line ();
while (status = ok) {
/* process line */
status = read_a_line ();
}
You could do this with a do/while, but then you'd have to
conditionalize the process line part. Anyway, it turns out that
turbo C recognizes the common code and jumped right into the
middle of the loop:
goto nextline:
while (status = ok) {
/* process line */
nextline:
status = read_a_line ();
}
It scared the hell out of me when I was debugging this, it didn't
execute the last instructions before the loop, and started somewhere
in the loop. Took a while to figure out that it had rewritten my code
a little and that it was still as I intended.
Moral: Yes it is possible to detect common pieces of code and to
emit those pieces only once.....
Roger.
-- ** R.E.Wolff@BitWizard.nl ** +31-15-2137555 ** http://www.BitWizard.nl/ ** Florida -- A 39 year old construction worker woke up this morning when a 109-car freigt train drove over him. According to the police the man was drunk. The man himself claims he slipped while walking the dog. 080897