OwnValues
OwnValues[x]
gives a list of transformation rules corresponding to all ownvalues defined for the symbol x.
OwnValues["symbol"]
gives a list of transformation rules corresponding to all ownvalues defined for the symbol named "symbol" if it exists.
Details and Options
- Ownvalues are definitions for the symbol appearing on its own.
- You can specify the ownvalues for x by making an assignment of the form OwnValues[x]=list.
- The list returned by OwnValues has elements of the form HoldPattern[lhs]:>rhs.
Examples
open allclose allScope (3)
Applications (2)
Properties & Relations (6)
Values can be defined by immediate or delayed assignments:
HoldPattern is used to protect the rules from their own definitions:
OwnValues has attribute HoldAll to protect against its argument's values:
OwnValues["sym"] will issue a message if the specified symbol does not exist:
If the symbol exists but has no definitions, an empty list is returned:
Definition and Information display ownvalues but do not return them as values:
OwnValues returns a value that can be used in a program:
Evaluation of a symbol is equivalent to applying the rules for its definition:
Text
Wolfram Research (1991), OwnValues, Wolfram Language function, https://reference.wolfram.com/language/ref/OwnValues.html (updated 2022).
CMS
Wolfram Language. 1991. "OwnValues." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2022. https://reference.wolfram.com/language/ref/OwnValues.html.
APA
Wolfram Language. (1991). OwnValues. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/OwnValues.html