in reply to Re: Insensitive Scoundrel
in thread Insensitive Scoundrel
So, why do we even have foreach and map as separate constructs when they do the same thing? Perhaps only for historical reasons. It makes sense to have a looping construct that applies a block to each item in a list. Now if the construct itself were to return a value, what would that value be? A list of all the "results" of the block makes perfect sence. So if you could use foreach as an expression rather than a statement, it would naturally be map.
And we all know that grep is a trivial usage of map. We don't really need it as a core part of the language, any more than we need chop.
—John
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Insensitive Scoundrel
by tadman (Prior) on Sep 27, 2002 at 01:07 UTC | |
by John M. Dlugosz (Monsignor) on Sep 27, 2002 at 14:42 UTC | |
by John M. Dlugosz (Monsignor) on Oct 03, 2002 at 19:03 UTC | |
by Aristotle (Chancellor) on Oct 04, 2002 at 20:22 UTC | |
|
Re: Re: Re: Insensitive Scoundrel
by chromatic (Archbishop) on Sep 26, 2002 at 23:44 UTC | |
|
Re: Re: Re: Insensitive Scoundrel
by jordanh (Chaplain) on Sep 28, 2002 at 16:53 UTC | |
by diotalevi (Canon) on Sep 28, 2002 at 17:35 UTC |