Memoized functions in Lua
$ luarocks install memoize
* Caches the results based on multiple parameters instead of just 1.
* Doesn't rely on `tostring`; instead, it uses operator `==` on all the
parameters (this is accomplished by structuring the cache in a
tree structure, where each tree node corresponds to one
* Works well with functions returning multiple values
* Can memoize both functions and "callable tables" (tables with a `__call`