Out of curiosity, why is the accumulator called memo in the inject/reduce methods? Is there some context/history behind its naming? Does it actually mean "memo" or does memo stand for something?
http://ruby-doc.org/core-2.0/Enumerable.html#method-i-inject
http://ruby-doc.org/core-2.0/Enumerable.html#method-i-reduce
"memo"
means in memory,that inject uses throughout its full iteration to hold the intermediate object state,to use it for its next iteration.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With