It sounds like you're not very familiar with functional programming. In a purely functional context, functions are only useful if they have a defined return value, otherwise might as well be comments. Scheme isn't purely functional (or it wouldn't have for-each), but this subset of Scheme probably is. It doesn't make sense to support functions that can't do anything, does it? In either case, for-each is always just an optimization because map does the same thing with a defined return value.-bobOn Jul 17, 2006, at 10:17 PM, andrew baker wrote:So, it's not the familiar "foreach x in y" iterator?On 7/17/06, Bob Ippolito < bob@xxxxxxxxxx> wrote:
On Jul 17, 2006, at 9:07 PM, andrew baker wrote:
> > Not available: for-each
>
> This puzzles me, as Python's own "for x in y" is a good example of
> a for-each.
for-each is only useful if you have procs with side-effects, it's
like map except the result is undefined.
-bob
--
Andrew Ulysses Baker
"failrate"