From: "Jesús Gabriel y Galán" Date: 2008-03-06T18:41:52+09:00 Subject: Re: Erratic result On Thu, Mar 6, 2008 at 10:08 AM, coolgeng coolgeng wrote: > Yeah, it does work. But I really want to know what does it happen? > such as "puts digits.each {|digit| dial(digit) }" This: puts digits.each {|digit| dial(digit) } is equivalent to this: a = digits.each {|digit| dial(digit) } puts a The first line is the loop and prints each digit. The second line prints the result of the each method. > or "digits.each {|digit| dial(digit) }" In this case you don't do anything with the return value of the each method. > the former will print the digits value at the last line,but the latter will > not Jesus.