up previous next
Clear

clear the working memory or a ring-bound memory
Syntax

Clear
Clear R_1,...,R_n

where the R_i are identifiers for rings.


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 ::= QQ[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 ::= QQ[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