Unassigning variables: VARS purge DelVar del restart rm_a_z rm_all_vars

### 5.4.9 Unassigning variables: VARS purge DelVar del restart rm_a_z rm_all_vars

Xcas has commands that help you keep track of what variables you are using and resetting them if desired. The VARS command will list all the variables that you are using, the purge, DelVar and del commands will delete selected variables, and the rm_a_z and rm_all_vars commands will remove classes of variables.

- VARS takes no arguments.
- VARS() returns a list of the variables that you have assigned values or made assumptions on.

Example.
Input:

a:= 1
anothervar:= 2

then:

VARS()

Output:

⎡ ⎣ | a,anothervar | ⎤ ⎦

The purge command will clear the values and assumptions you make on variables (see Section 5.4.8). For TI compatibility there is also DelVar, and for Python compatibility there is del.

- The purge command takes one argument:
  var, the name of a variable.
- purge(var) clears the variable var of all values and assumptions.

- The DelVar (and del) commands take one argument:
  var, the name of a variable.
- Delvar var (or del var) removes the values attached to var. (Note that they do not take their argument in parentheses.

Example.
To clear the variable a:
Input:

purge(a)

or (for TI compatibility):
Input:

DelVar a

or (for Python compatibility):
Input:

del a

The rm_all_vars and restart commands clear the values and assumptions you have made on all variables you can use.

- rm_all_vars takes no arguments.
- rm_all_vars() removes all the values that you have attached to variables.

- restart takes no arguments.
- restart removes all the values that you have attached to variables. (Note that it does not use parentheses.)

The rm_a_z command clears the values and assumptions on all variables with single lowercase letter names.

- rm_a_z takes no arguments.
- rm_a_z() purges all variables whose names are one letter and lowercase.

Example.
If you have variables names A,B,a,b,myvar, then after:
Input:

rm_a_z()

you will only have the variables named A,B,myvar.