> Perhaps some of us like to do our iteration explicitly. I don't think
> there is any syntactic overhead, and the for loop reads
> better. Counterexamples welcome.
> 
> Obviously we can do #each too:
> 
> def L(x):
>     print x
>     return x*2
> 
> map(L, [1,2,3])
> 
(reverse (map (lambda (x) (begin (display x) (* x 2)))
      (map (lambda (x) (+ x 2)) (list 1 2 3))))

[1,2,3].each {|x| x+2}.each {|x| print x;return x*2}.reverse

or if you prefer

[1,2,3].each {|x| x+2}.each do |x|
	print x
	x*2
end.reverse

(yes these are contrived but I have had many situations where something 
like this was necessary)

I don't know alot of about python, but from what I have gathered it 
appears it follows the lisp style of functions, to a certain degree.
However, I found the ruby reordering much more readable, and an 
equivalent reordering in another language is not feasable without a 
yield syntax, and everything returning something.  "Do this, then this, 
then this", seems far more readable then by evaluating inside out.  In 
addition, passing the lambda block to the map always caused readability 
problems for me.  If you nested a couple of maps it became difficult to 
read which parts were the logic of the map and which part was the list. 
  Addmittidly some of this may be from the uniformness of lisp/scheme 
code that comes from the paranthesis, but this syntax still suffers from 
a basic difficulty.  If I embed the logic at the point of call with a 
lambda block I lose readability because it makes it difficult to find 
what is being processed.  Or, if I put the logic in another function, 
the logic is seperated, forcing me to look elsewhere to see what the map 
is doing.  That's what I love about ruby's yield syntax combined with 
objects, they give me a chaining that I find far more readable then 
nested calls.

 > But plain old for loop is more convenient, esp. if you don't need to
 > generate a result list in the process.

a = [1,2,3]
a = for x in a
	print x
         x + 2
     end.reverse

In ruby you don't need to choose between map and for if you want the 
result list, you can do whichever pleases you the most.

But I suppose that is reaon to choose what language you prefer, 
whichever pleases you the most,

Charles Comstock