That's it: an infinitely looping foreach isn't a foreach. It's not a foreach in perl. It's not a for-each in standart scheme either, as r5rs clearly says that the arguments to for-each are lists. (In some interpreters, you can give an infinite list to for-each, but that's clearly an extension. Others, like mzscheme, raise an error on an infinite list.) For in sh and foreach in csh won't allow you to loop infinitely (except for the new arithmetic for loop in bash, but that's not a foreach loop, it's rather a c-style for loop).
In reply to Re^3: If I was forced to use only one kind of loop for the rest of my days it would be a
by ambrus
in thread If I was forced to use only one kind of loop for the rest of my days it would be a
by collin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |