3 ms·
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 mn
by mhartl 19y ago
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.