Skip to content

clear

builtin · libnexusinterp/corefcn/variables-proprietary.cc

: clear
: clear pattern …
: clear options pattern …

Delete variables, functions or classes from the current workspace.

Without arguments all local variables are deleted. Patterns may use the wildcards ‘*’, ‘?’ and ‘[…]’. The words all, variables, functions, classes, global and persistent select the kind of symbol to clear. Options (each also available in its long form) are:

-all, -a

Clear all local and global variables, functions and classes.

-exclusive, -x

Clear all variables except those matching the patterns.

-functions, -f

Clear functions.

-global, -g

Clear global variables.

-variables, -v

Clear local variables.

-classes, -c

Clear classes.

-regexp, -r

Treat the patterns as regular expressions.