DownValues

DownValues[f]

gives a list of transformation rules corresponding to all downvalues defined for the symbol f.

Details and Options

  • You can specify the downvalues for f by making an assignment of the form DownValues[f]=list.
  • The list returned by DownValues has elements of the form HoldPattern[lhs]:>rhs.

Examples

open allclose all

Basic Examples  (1)

Define values for a function f:

These are the downvalues associated with f:

Scope  (2)

DownValues returns rules corresponding to definitions made for a symbol:

DownValues can be used to set the values directly:

Applications  (2)

The resulting rules are in the order given:

Now reorder the definitions:

Copy a symbol's definitions to another symbol:

Properties & Relations  (4)

Values can be defined by immediate or delayed assignments:

HoldPattern is used to protect the rules from their own definitions:

Definition and Information display downvalues but do not return them as values:

DownValues returns a value that can be used in a program:

Evaluation of an expression involves applying rules for its head:

Wolfram Research (1991), DownValues, Wolfram Language function, https://reference.wolfram.com/language/ref/DownValues.html (updated 1996).

Text

Wolfram Research (1991), DownValues, Wolfram Language function, https://reference.wolfram.com/language/ref/DownValues.html (updated 1996).

BibTeX

@misc{reference.wolfram_2021_downvalues, author="Wolfram Research", title="{DownValues}", year="1996", howpublished="\url{https://reference.wolfram.com/language/ref/DownValues.html}", note=[Accessed: 18-October-2021 ]}

BibLaTeX

@online{reference.wolfram_2021_downvalues, organization={Wolfram Research}, title={DownValues}, year={1996}, url={https://reference.wolfram.com/language/ref/DownValues.html}, note=[Accessed: 18-October-2021 ]}

CMS

Wolfram Language. 1991. "DownValues." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 1996. https://reference.wolfram.com/language/ref/DownValues.html.

APA

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