You shouldn't use map or grep for this purpose. map transforms one list into another, applying a given function to each element in turn. grep filters a list by applying a given function which returns a boolean value to each element in turn.
You're relying on side-effects of their implementation, and that'll cause you grief.
In reply to Re: Different behaviors between "while" and "map"
by chromatic
in thread Different behaviors between "while" and "map"
by lightoverhead
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |