Skip to content

Conversation

dark-panda
Copy link

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.

Copy link
Contributor

@pboling pboling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love this! Any idea about the build failure?

@dark-panda
Copy link
Author

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 dark-panda force-pushed the allow-operator-memoizing branch from 9f57b37 to 8f57f8f Compare November 29, 2018 23:42
@dark-panda
Copy link
Author

Re-rolled and fixed

@dark-panda dark-panda closed this Nov 29, 2018
@dark-panda dark-panda reopened this Nov 29, 2018
@pboling
Copy link
Contributor

pboling commented Nov 30, 2018

Very nice! @matthewrudy Please review.

@dark-panda
Copy link
Author

Any chance on this getting merged, @matthewrudy?

@pboling
Copy link
Contributor

pboling commented Apr 12, 2019

ping @matthewrudy 👍

@sebjacobs sebjacobs force-pushed the master branch 2 times, most recently from 9d66c95 to 34f90dd Compare November 8, 2019 21:05
@dark-panda
Copy link
Author

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

@dark-panda dark-panda force-pushed the allow-operator-memoizing branch from 8f57f8f to 7fac529 Compare November 4, 2020 16:02
@dark-panda
Copy link
Author

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

@pboling
Copy link
Contributor

pboling commented Jun 5, 2022

@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).

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 dark-panda force-pushed the allow-operator-memoizing branch from 7fac529 to 273c9f4 Compare June 7, 2022 17:18
@pboling
Copy link
Contributor

pboling commented Jun 4, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants