On Thu, Nov 20, 2014 at 4:37 PM, George Drummond <drummond / rentify.com>
wrote:

> Another valid option would be
>
> def sum(*numbers)
>   numbers.reduce(&:+)
> end
>


$ ruby <<CODE
> def sum(*numbers)
>   numbers.reduce(&:+)
> end
> p sum()
> CODE
nil

Same store: empty list is not properly dealt with.

Cheers

robert

-- 
[guy, jim].each {|him| remember.him do |as, often| as.you_can - without end}
http://blog.rubybestpractices.com/