Cache
RemovePermanent
remove a permanent entry from the cache table
Calling Sequence
Parameters
Description
Examples
RemovePermanent( cache, key )
cache
-
cache table or procedure: the object the entry is removed from
key
list: the key to remove
The RemovePermanent command removes the permanent entry for which key is the key. The cache table can be given directly as cache, or cache can refer to a procedure that has, or can have, a cache remember table. If such a procedure is given and it has a cache remember table, the permanent entry is removed from that table. If the procedure does not have a table, no action is taken.
To handle an expression sequence as a key, key must be given in a list. The actual key used for the entry is op(key).
Calling RemovePermanent is the only way to remove a permanent entry from a cache table.
To add a permanent entry to a cache table, use AddPermanent.
For more information on cache tables, see Cache Package.
c1≔Cache
c1≔Cache512
Cache:-AddPermanentc1,x,y
Cache:-AddPermanentc1,y,z
evalc1
Cache512,permanent=y=z,x=y
Cache:-RemovePermanentc1,x
Cache512,permanent=y=z
Cache:-RemovePermanentc1,y
Cache512
p := proc(x,y) option cache; x+y; end proc;
p ≔ procx,yoptioncache;x+yend proc
p1,1
2
Cache:-AddPermanentp,2,2,8
Cache:-AddPermanentp,1,2,5
p2,2
8
p1,2
5
Cache:-RemovePermanentp,2,2
4
op4,evalp
Cache512,temporary=1,1=2,2,2=4,permanent=1,2=5
Cache:-RemovePermanentp,1,2
3
Cache512,temporary=1,2=3,1,1=2,2,2=4
See Also
Cache Package
Cache[AddPermanent]
Cache[AddTemporary]
Cache[PermanentEntries]
Cache[PermanentIndices]
Cache[RemoveTemporary]
Cache[Resize]
Cache[TemporaryEntries]
Cache[TemporaryIndices]
option cache
Download Help Document