in reply to Re: When would you choose foreach instead of map?
in thread When would you choose foreach instead of map?
Sorry, but I just cannot agree, or even let this lay unchallenged. map and foreach are indeed different operations, as others have pointed out to great clarity. And the reason they are both in the language is because of their differences, not their similarities.
map is largely key to the "Schwartzian Transform". It not only produces a list as a side-effect (which foreach doesn't), it can produce very elaborate transformations of the input in the process. map is not hideous simply because someone doesn't understand it as well as foreach. Indeed, for those of us with a Lisp background, it's immediatly intuitive.
--rjray
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: When would you choose foreach instead of map?
by dragonchild (Archbishop) on May 21, 2004 at 13:11 UTC | |
by rjray (Chaplain) on May 22, 2004 at 00:08 UTC |