We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
memoize
For example:
require 'memoist' class Foo extend Memoist def [](bar) rand end memoize :[] end
[22:03:27] ~/projects ➜ ruby brackets.rb Traceback (most recent call last): 8: from brackets.rb:3:in `<main>' 7: from brackets.rb:9:in `<class:Foo>' 6: from /Users/pat/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/memoist-0.16.2/lib/memoist.rb:127:in `memoize' 5: from /Users/pat/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/memoist-0.16.2/lib/memoist.rb:127:in `each' 4: from /Users/pat/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/memoist-0.16.2/lib/memoist.rb:131:in `block in memoize' 3: from /Users/pat/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/memoist-0.16.2/lib/memoist.rb:55:in `memoist_eval' 2: from /Users/pat/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/memoist-0.16.2/lib/memoist.rb:55:in `class_eval' 1: from /Users/pat/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/memoist-0.16.2/lib/memoist.rb:205:in `block (2 levels) in memoize' /Users/pat/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/memoist-0.16.2/lib/memoist.rb:205:in `module_eval': /Users/pat/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/memoist-0.16.2/lib/memoist.rb:213: syntax error, unexpected '(', expecting `end' (SyntaxError) ... value = _unmemoized_[](*args) ... ^
This is true also of methods such as +, +@, -, -@, &, |, etc.
+
+@
-
-@
&
|
The text was updated successfully, but these errors were encountered:
FYI: Added this alert to the new memoist repo
Important
Consider using MemoWise instead, as it is maintained, fully tested, provides thread safety guarantees, and is much, much faster.
In case you need a tool with this feature set that is currently maintained, check out:
Tip
Seriously though, read the important note above.
Warning
If you must continue - be aware that this is unmaintained software.
Sorry, something went wrong.
No branches or pull requests
For example:
This is true also of methods such as
+
,+@
,-
,-@
,&
,|
, etc.The text was updated successfully, but these errors were encountered: