zdennis wrote:
> The sum example with inject IMO is great...
>
> numbers = 1, 3, 5, 7, 9, 11, 13, 15, 17
> sum = numbers.inject( 0 ){ |sum,n| sum+=n }
> puts "The sum is #{sum}!"
Maybe a little too cryptic? Keep in mind this example might be the first
example someone ever sees of Ruby.
--
John Long
http://wiseheartdesign.com