[chuck-dev] for loop, empty conditional statement, possible fix

Kassen signal.automatique at gmail.com
Fri Oct 23 09:13:16 EDT 2009

Hi Szilveszter,
> I also checked out the source code and made a change which made this loop
> work:
> at chuck_dev\v2\chuck_type.cpp:873:
> I enclosed the switch() block in a conditional:
> if (stmt->c2) { ... }
> Now it seems to work.
First; great job on fixing this crash, that's the spirit!

I do have a question though. It seems that you are implying here that a
empty condition now evaluates to true (or at least not false). Assuming we
adopt this fix; would this now be true in the general case, or just for
"for" loops? Are there precedents on empty conditions evaluating to true?
Just curious; crash prevention is the main thing here, I don't see much
practical use in empty "for" loops anyway, because "while(1)" is just as one
character more than "for(;;)" and a lot more readable.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/chuck-dev/attachments/20091023/ce3937bf/attachment.htm>

More information about the chuck-dev mailing list