Thank you very much for taking the time to explain. It's highly appreciated. I'm still interested in the technical background. If answering my questions takes too much time feel free to ignore them.

Originally Posted By: jcl
"Fixing" it would require to re-write the for and while loop handling in the compiler...

I still don't understand the way you implemented for loops and why a "wait" is a special case here. For loops are nothing else but syntactical sugar. Any for loop like
Code:
for (expr1; expr1; expr3)
{
   body;
}

can easily replaced by
Code:
expr1;
while (expr2)
{
   body;
   expr3;
}

The only pitfall here is that if you have a "continue;" in the body you have to replace it with a "expr3; continue;". But that's it. Once you got the while loop you get the for loop almost for free. It shouldn't even be necessary to touch the actual compiler code for this.
Originally Posted By: jcl
You just don't program in this way when you want clean code
What's unclean about it? I wonder why noone had the idea for a macro like
Code:
#define each_frame for (;; wait(1))

This would effectively prevent you from programming endless loops because you forgot a wait. E.g.
Code:
each_frame
{
   draw_quad(...);
}


Originally Posted By: jcl
In fact we would put a lot of effort in ending up with a worse software than before.
I have to keep this in mind for my work.
Boss: There is a bug in your code. Fix it!
Me: No, introducing special cases will only reduce maintainability and make the software worse.
grin


Always learn from history, to be sure you make the same mistakes again...