matthewrudy / memoist

ActiveSupport::Memoizable with a few enhancements
MIT License
920 stars 99 forks source link

Allow operator methods to be memoized #79

Open dark-panda opened 5 years ago

dark-panda commented 5 years ago

Memoizing operators will raise a syntax error due to the operator symbols being injected into the eval'd code. We can allow operator memoization by using some mangled names instead. To (hopefully) avoid clashing with any existing method names, we've added some underscores to the names and upper-cased them.

dark-panda commented 5 years ago

Yeah, looks like older versions of Ruby aren't fans of that hash syntax. I'll fix these up and reroll shortly, shouldn't be a problem.

dark-panda commented 5 years ago

Re-rolled and fixed

pboling commented 5 years ago

Very nice! @matthewrudy Please review.

dark-panda commented 5 years ago

Any chance on this getting merged, @matthewrudy?

pboling commented 5 years ago

ping @matthewrudy 👍

dark-panda commented 4 years ago

Been a year now, figured I'd check in.

dark-panda commented 3 years ago

It's that time of year again. Just checking in on my PR.

pboling commented 2 years ago

@dark-panda Matthew, the owner of this repo, died in 2019. I just found out. I have created a new org in his memory, called memoist. I'm adding you to it (don't have to accept if you'd rather not).

pboling commented 3 months ago

FYI: Added this alert to the new memoist repo

[!IMPORTANT]

Recommendation

Consider using MemoWise instead, as it is maintained, fully tested, provides thread safety guarantees, and is much, much faster.

Other Alternatives

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.