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
Other common implementations of memoize usually allow to reset the cache. For example, this is quite common in python:
@memoize
def square (x):
return x*x
square(2)
square(3)
square.cache.clear()
It would be helpful if we could accomplish the same with std.functional.memoize.
The text was updated successfully, but these errors were encountered:
aurelien.fredouelle+dlang commented on 2019-05-12T12:01:54Z
Just tried implementing this by making memoize a struct with a static opCall: https://github.com/dlang/phobos/compare/master...AurelC2G:19859-memoize-cache-clear
However I ran into bug #18289, so this doesn't work as-is.
Any suggestions?
aurelien.fredouelle+dlang (@AurelC2G) reported this on 2019-05-11T08:51:53Z
Transfered from https://issues.dlang.org/show_bug.cgi?id=19859
Description
The text was updated successfully, but these errors were encountered: