Function: disremember - produce procedure without option remember.

Calling Sequences:

disremember(P);

disremember(P,x);

Parameters:

P - procedure.

x - anything.

Description:

Examples

Define a procedure having option remember .

> F:= proc(x) option remember; x^2+1 end;

F := proc (x) option remember; x^2+1 end proc

Produce some values in its remember table.

> F(1),F(2),F(3):
op(4,eval(F));

TABLE([1 = 2, 2 = 5, 3 = 10])

Here is a version without option remember , but with the existing remember table entries.

> G:= disremember(F);

G := proc (x) x^2+1 end proc; G(1) := 2; G(2) := 5;...

> op(4,eval(G));

TABLE([1 = 2, 2 = 5, 3 = 10])

These remember tables are separate: adding or changing an entry in one won't change the other.

> F(1):= foo: G(1):= goo:
op(4,eval(G)); op(4,eval(F));

TABLE([1 = goo, 2 = 5, 3 = 10])

TABLE([1 = foo, 2 = 5, 3 = 10])

Here's another version with no remember table.

> H:= disremember(F,0);

H := proc (x) x^2+1 end proc

> op(4,eval(H));

Not having a remember table allows H to be executed under evalhf .

> evalhf(H(1));

2.

> evalhf(F(5));

Error, remember tables are not supported in evalhf

See also: Error: remember tables are not supported in evalhf , forget , remember , sniffmem

Maple Advisor Database R. Israel, 1999