 RemovePermanent - Maple Help

Cache

 RemovePermanent
 remove a permanent entry from the cache table Calling Sequence RemovePermanent( cache, key ) Parameters

 cache - cache table or procedure: the object the entry is removed from key - list: the key to remove Description

 • 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. Examples

 > $\mathrm{c1}≔\mathrm{Cache}\left(\right)$
 ${\mathrm{c1}}{≔}{\mathrm{Cache}}{}\left({512}\right)$ (1)
 > $\mathrm{Cache}:-\mathrm{AddPermanent}\left(\mathrm{c1},\left[x\right],y\right)$
 > $\mathrm{Cache}:-\mathrm{AddPermanent}\left(\mathrm{c1},\left[y\right],z\right)$
 > $\mathrm{eval}\left(\mathrm{c1}\right)$
 ${\mathrm{Cache}}{}\left({512}{,}'{\mathrm{permanent}}'{=}\left[{y}{=}{z}{,}{x}{=}{y}\right]\right)$ (2)
 > $\mathrm{Cache}:-\mathrm{RemovePermanent}\left(\mathrm{c1},\left[x\right]\right)$
 > $\mathrm{eval}\left(\mathrm{c1}\right)$
 ${\mathrm{Cache}}{}\left({512}{,}'{\mathrm{permanent}}'{=}\left[{y}{=}{z}\right]\right)$ (3)
 > $\mathrm{Cache}:-\mathrm{RemovePermanent}\left(\mathrm{c1},\left[y\right]\right)$
 > $\mathrm{eval}\left(\mathrm{c1}\right)$
 ${\mathrm{Cache}}{}\left({512}\right)$ (4)
 > p := proc(x,y) option cache; x+y; end proc;
 ${p}{≔}{\mathbf{proc}}\left({x}{,}{y}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{option}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{cache}}{;}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{x}{+}{y}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end proc}}$ (5)
 > $p\left(1,1\right)$
 ${2}$ (6)
 > $\mathrm{Cache}:-\mathrm{AddPermanent}\left(p,\left[2,2\right],8\right)$
 > $\mathrm{Cache}:-\mathrm{AddPermanent}\left(p,\left[1,2\right],5\right)$
 > $p\left(2,2\right)$
 ${8}$ (7)
 > $p\left(1,2\right)$
 ${5}$ (8)
 > $\mathrm{Cache}:-\mathrm{RemovePermanent}\left(p,\left[2,2\right]\right)$
 > $p\left(2,2\right)$
 ${4}$ (9)
 > $\mathrm{op}\left(4,\mathrm{eval}\left(p\right)\right)$
 ${\mathrm{Cache}}{}\left({512}{,}'{\mathrm{temporary}}'{=}\left[\left({2}{,}{2}\right){=}{4}{,}\left({1}{,}{1}\right){=}{2}\right]{,}'{\mathrm{permanent}}'{=}\left[\left({1}{,}{2}\right){=}{5}\right]\right)$ (10)
 > $\mathrm{Cache}:-\mathrm{RemovePermanent}\left(p,\left[1,2\right]\right)$
 > $p\left(1,2\right)$
 ${3}$ (11)
 > $\mathrm{op}\left(4,\mathrm{eval}\left(p\right)\right)$
 ${\mathrm{Cache}}{}\left({512}{,}'{\mathrm{temporary}}'{=}\left[\left({1}{,}{2}\right){=}{3}{,}\left({2}{,}{2}\right){=}{4}{,}\left({1}{,}{1}\right){=}{2}\right]\right)$ (12)