Skip to content
New issue

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

Allow formulas to depend on function arguments? #124

Open
DarwinAwardWinner opened this issue Mar 12, 2021 · 0 comments
Open

Allow formulas to depend on function arguments? #124

DarwinAwardWinner opened this issue Mar 12, 2021 · 0 comments

Comments

@DarwinAwardWinner
Copy link

I have a function that I am memoising, which reads information from a file. Specifically, it reads a 7 GB JSON file and only keeps a small part of it. The function takes the file name as an argument, and I'd like to be able to invalidate the cache if the contents of the file change even if the file name is the same (e.g. I want the cache value to depend on file.info(filename). However, it seems that with the current interface there is no way to accomplish this, because the additional formulae provided to memoise in ... cannot refer to the function's arguments. Is there any way to change this, e.g. evaluating the formulae in an environment containing the function's arguments?

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

No branches or pull requests

1 participant