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:

Wolfram Research (1988), Unset, Wolfram Language function, https://reference.wolfram.com/language/ref/Unset.html (updated 2016).

Text

Wolfram Research (1988), Unset, Wolfram Language function, https://reference.wolfram.com/language/ref/Unset.html (updated 2016).

CMS

Wolfram Language. 1988. "Unset." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2016. https://reference.wolfram.com/language/ref/Unset.html.

APA

Wolfram Language. (1988). Unset. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Unset.html

BibTeX

@misc{reference.wolfram_2024_unset, author="Wolfram Research", title="{Unset}", year="2016", howpublished="\url{https://reference.wolfram.com/language/ref/Unset.html}", note=[Accessed: 22-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_unset, organization={Wolfram Research}, title={Unset}, year={2016}, url={https://reference.wolfram.com/language/ref/Unset.html}, note=[Accessed: 22-November-2024 ]}