In Ruby, why is the drive called memo in input / reduction methods?

Out of curiosity, why is the battery called memo in injection / contraction methods? Is there any context / story behind its name? Does it actually mean a β€œmemo” or a memo 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

+4
source share
2 answers

"memo" means in memory that the application uses its entire full iteration to store the intermediate state of the object so that it can be used for the next iteration.

+4
source

I do not have a reliable source for this application, but I think this is a shorthand for β€œmemory”, since this information is stored between iterations.

+2
source

Source: https://habr.com/ru/post/1497310/


All Articles