Re:(1..100).inject(&:+)
by raganwald on Monday February 25, 2008 @04:26PM
(#123358)
Actually, it's &(:+) not &:(+). The & takes its argument and converts from a Proc to a block. :+ is a symbol that implements the method #to_proc to give you a block that sums its receiver and its argument.
[ Parent
| on HN ]