News for hackers. Stuff that matters.
Re:(1..100).inject(&:+) by mhartl on Monday February 25, 2008 @05:35PM (#123415)
I use Symbol#to_proc every day. I've never cared for the term "inject", though (or Python's "reduce", for that matter); I find SICP's "accumulate" much more mnemonic.

For what it's worth,

(1..100).to_a.sum

works in Rails, though

(1..100).sum

doesn't.

There are no comments on this comment yet.