You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for this package! I'm looking for higher order function memoization, e.g. I'd like to be able to do: memoized_f = @memoize expensive_function_from_package, but this triggers ERROR: LoadError: @memoize must be applied to a method definition.
As a workaround, I currently do
@memoizefunctionmemoized_f(args...)
expensive_function_from_package(args...)
end
But not sure that this is fully generic. Is this a fundamental restriction due to the function/method implementation?
The text was updated successfully, but these errors were encountered:
You mean that you would like to memoize a call? Like
functionmy_function()
@memoizesome_expensive_call(...)
end
? That's currently outside of the realm of this package, but it could be done I suppose if the macroexpansion looked up a cache in some global variable. Like get!(global_cache_dict, @__MODULE__, @__LINE__) or something.
Thanks for this package! I'm looking for higher order function memoization, e.g. I'd like to be able to do:
memoized_f = @memoize expensive_function_from_package
, but this triggersERROR: LoadError: @memoize must be applied to a method definition
.As a workaround, I currently do
But not sure that this is fully generic. Is this a fundamental restriction due to the function/method implementation?
The text was updated successfully, but these errors were encountered: