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
For some reason I feel like I’ve seen this mentioned before, but can’t find it now (maybe I saw it in the code?). Anyway, using cache as a keyword argument for a memoized function doesn’t work as expected and should probably throw an error if that’s possible:
julia>using Memoization
julia>@memoizef1(x; cache=(; abc="xyz")) =println("$x, $cache")
f (generic function with 1 method)
julia>f1(111)
111, IdDict{Any, Any}()
julia>f1(111; cache=(; abc="xyz"))
julia>@memoizef2(x; cache) =println("$x, $cache")
f2 (generic function with 1 method)
julia>f2(111, cache=(; abc="xyz"))
111, IdDict{Any, Any}()
julia>g(x; cache=(; abc="xyz")) =println("$x, $cache")
g (generic function with 1 method)
julia>g(111)
111, (abc ="xyz",)
If it’s not possible to detect this and throw an error for some reason, it should at least be documented.
The text was updated successfully, but these errors were encountered:
For some reason I feel like I’ve seen this mentioned before, but can’t find it now (maybe I saw it in the code?). Anyway, using
cache
as a keyword argument for a memoized function doesn’t work as expected and should probably throw an error if that’s possible:If it’s not possible to detect this and throw an error for some reason, it should at least be documented.
The text was updated successfully, but these errors were encountered: