CoCoA:Clear
From ApCoCoAWiki
Clear
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 <quotes>ENV</quotes> is equivalent to <quotes>MEMORY.ENV</quotes> 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 [<quotes>I</quotes>, <quotes>J</quotes>, <quotes>UserInitFile</quotes>, <quotes>Z</quotes>] ------------------------------- Memory(R); -- the global variables bound to R [<quotes>X</quotes>] ------------------------------- Memory(S); -- the global variables bound to S [<quotes>Y</quotes>] ------------------------------- Clear; -- clear the working memory Memory(); [ ] ------------------------------- Clear R; -- clear the global variables bound to R Memory(R); [ ] ------------------------------- Memory(S); [<quotes>Y</quotes>] ------------------------------- ENV.S.Y; -- this variable was never cleared Ideal(a^2) -------------------------------
Syntax
Clear Clear R_1,...,R_n where the R_i are identifiers for rings.
<type>ring</type> <type>memory</type>