From: Jari Williamsson Date: 2008-03-06T17:56:56+09:00 Subject: Re: Erratic result coolgeng coolgeng wrote: > I do not know how to explain the different result between the two > snippets: > First snippet: > def dial(digit) > puts digit end > digits = 0..9 > puts digits.each {|digit| dial(digit) } > > output: > 0 > 1 > 2 > 3 > 4 > 5 > 6 > 7 > 8 > 9 > 0..9 You probably want this: def dial(digit) puts digit end digits = 0..9 digits.each {|digit| puts dial(digit) } Best regards, Jari Williamsson