Unset

lhs=.

removes any rules defined for lhs.

Details

  • Rules are removed only when their lefthand sides are identical to lhs, up to renaming of patterns.
  • Unset[Once[expr]] removes any stored value for Once[expr].

Examples

open allclose all

Basic Examples  (2)

Undefine a value:

Undefine a function:

Scope  (2)

Clear values of variables:

Clear functions (downvalues):

Properties & Relations  (2)

Use =. to clear definitions with a particular left-hand side:

Clear all definitions:

Use Unset[Once[expr]] to clear a remembered value of Once:

Possible Issues  (1)

To clear an upvalue, the tag has to be given:

Introduced in 1988
 (1.0)
 |
Updated in 2016
 (11.0)