in reply to Re^5: For vs. Foreach
in thread For vs. Foreach
/me sighs.
Do you not see that fundamentally, the C-style for loop (three parts in prefix, no automatic localization) uses a different pattern of behavior from a csh-style foreach loop (always one localized variable, always stepping forward one item at a time through a list or array)? That's not just an "obscure implementation distinction". And that I choose to keep it simple for people by omitting "C-style" and "csh-style", using the shorthand "for" vs "foreach". It's not just that the keywords are interchangeable... they are fundamentally different types of loops, much as a while loop is a third category. Or are you going to say that "while is just a for loop with some obscure implementation distinction" as well? Madness.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^7: For vs. Foreach
by BrowserUk (Pope) on Feb 15, 2009 at 05:13 UTC |