((cacheValue KEY) f) x
|
|
|
|
|
|
../../../../../../../Macaulay2/m2/methods.m2:652:18-661:26: --source code:
cacheValue = key -> f -> new CacheFunction from (x -> (
c := try x.cache else x.cache = new CacheTable;
if c#?key then (
val := c#key;
if class val === CacheFunction then (
remove(c,key);
c#key = val x)
else val
)
else c#key = f x))
The object cacheValue is a function closure.