next | previous | forward | backward | up | top | index | toc | home
Macaulay2 > The Macaulay2 language > variables > viewing the symbols defined so far

viewing the symbols defined so far

After using Macaulay 2 for a while, you may have stored data in several variables. The system also stores output values for you in output variables. You may wish to free the memory space occupied by that data, or you may simply wish to remind yourself where you stored a previously computed value.

We may use the command listUserSymbols to obtain a list of the user's symbols encountered so far.

i1 : ff = 20:4; h = true; kk

o3 = kk

o3 : Symbol
i4 : listUserSymbols

o4 = symbol class     value                                                  location of symbol
     ------ -----     -----                                                  ------------------
     ff    :Sequence--(4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,$stdio:1:0-1:0     
     h     :Boolean --true                                                   stdio:1:11-1:11   
     kk    :Symbol  --kk                                                     stdio:1:21-1:21   
The symbols are listed in chronological order, and the type of value stored under it is displayed.

We can clear the output symbols with clearOutput.

i5 : clearOutput
i6 : listUserSymbols

o6 = symbol class     value                                                  location of symbol
     ------ -----     -----                                                  ------------------
     ff    :Sequence--(4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,$stdio:1:0-1:0     
     h     :Boolean --true                                                   stdio:1:11-1:11   
     kk    :Symbol  --kk                                                     stdio:1:21-1:21   
We can clear all the symbols with clearAll.
i7 : clearAll
i8 : listUserSymbols

o8 = symbolclassvaluelocation of symbol
     ----------------------------------