It not only produces a list as a side-effect (which foreach doesn't), ...
What on earth are you smoking?!? The entire point of map is to produce a list. The list production isn't a side-effect ... it's the whole effect. Modifying the original list is a side-effect.
------
We are the carpenters and bricklayers of the Information Age.
Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose
I shouldn't have to say this, but any code, unless otherwise stated, is untested
| [reply] [Watch: Dir/Any] |
Wow, and here I thought the purpose of map was to evaluation the block or expression over the range of the list passed to it. Perhaps you thought that by "side-effect", I meant that the creation of the output list was an accidental, unintentional thing. No. I meant "side-effect" in the same sense that most people use it with regards to programming.
I'm quite well aware of the differences between map and foreach, and the conditions under which you would choose one or the other. Try to take a less confrontational tone, it will usually get you better responsiveness from others.
--rjray
| [reply] [Watch: Dir/Any] |