up
previous
next
Clear
Syntax
Clear
Clear R_1,...,R_n
where the R_i are identifiers for rings.
Summary
clear the working memory or a ring-bound memory
Description
The first form clears the working memory, i.e, all non-global
variables. In the second form, the command clears the global
variables bound to the rings R_1,...,R_n
, i.e., the ring-bound
memory for these rings. For more information on memory in CoCoA, see
the chapter entitled "Memory Management".
The contents of the working memory are listed by the command
Memory()
, and the global variables bound to the ring R are listed by
the command Memory(R)
.
example
Use R ::= Q[x,y,z];
I := Ideal(x,y); -- I is added to the working memory
MEMORY.X := 3; -- a global variable
ENV.R.X := Ideal(x); -- a global variable bound to the ring R
-- note that "ENV" is equivalent to "MEMORY.ENV"
Use S ::= Q[a,b];
ENV.S.Y := Ideal(a^2); -- global variable bound to S
J := Ideal(a,b); -- J is added to the working memory
Z := 4; -- Z is added to the working memory
Memory(); -- the contents of the working memory
["I", "J", "UserInitFile", "Z"]
-------------------------------
Memory(R); -- the global variables bound to R
["X"]
-------------------------------
Memory(S); -- the global variables bound to S
["Y"]
-------------------------------
Clear; -- clear the working memory
Memory();
[ ]
-------------------------------
Clear R; -- clear the global variables bound to R
Memory(R);
[ ]
-------------------------------
Memory(S);
["Y"]
-------------------------------
ENV.S.Y; -- this variable was never cleared
Ideal(a^2)
-------------------------------
See Also