memoize

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
parameter).
* Works well with functions returning multiple values
* Can memoize both functions and "callable tables" (tables with a `__call`
metamethod)

Versions

2.0.0-06 years ago1,761 downloads

Dependencies

lua >= 5.1

Manifests