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
Should memoize be sensitive to options?
memoize
I can see arguments both ways:
I don't think using memoize (as opposed to other means of caching) should be recommended anyway, so maybe this is a moot point.
The text was updated successfully, but these errors were encountered:
Note that it's not so easy to use memoize with say a method with options, as I think I pointed out in some other thread. e.g., givin
f= method(Options=>new OptionTable from{a=>1})
neither
f ZZ := o -> memoize(x -> (print (x,o#a); x+o#a))
nor
f ZZ := memoize(o -> x -> (print (x,o#a); x+o#a))
will work, as can be checked by applying repeatedly. this does work:
f ZZ := memoize(o -> memoize(x -> (print (x,o#a); x+o#a)))
but seems heavy. If one wants to ignore the option for memoize purposes, I don't even know any simple option.
Sorry, something went wrong.
No branches or pull requests
Should
memoize
be sensitive to options?I can see arguments both ways:
I don't think using
memoize
(as opposed to other means of caching) should be recommended anyway, so maybe this is a moot point.The text was updated successfully, but these errors were encountered: