Hmmm.. I'm inclined to doubt that this is true for all cases. In principle, I'd agree, but saying that anything expecting a return list is too simple an assumtion.
I'm quite sure (although I'm too lazy now, to come up with some proof) that I'd find a map with a discarded return list that does something faster than an equivalent for/foreach.
BTW, has someone thought that a smart while() might be fastest anyway?
In reply to Re^2: grep, map vs. foreach performance
by Flexx
in thread grep, map vs. foreach performance
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |