Definition[symbol]
prints as the definitions given for a symbol.
Definition[patt]
prints as the definitions given for the symbols whose names textually match the arbitrary string pattern patt.
Definition[{spec1,spec2,…}]
prints as the definitions given for the symbols that are equal to or or whose names match any of the speci.
Definition
Definition[symbol]
prints as the definitions given for a symbol.
Definition[patt]
prints as the definitions given for the symbols whose names textually match the arbitrary string pattern patt.
Definition[{spec1,spec2,…}]
prints as the definitions given for the symbols that are equal to or or whose names match any of the speci.
Details
- Definition[symbol] prints as all values, attributes, defaults and options for symbol. »
- The pattern patt can be given as a string with metacharacters, as StringExpression[…] or as RegularExpression["regex"]. »
- Definition allows abbreviated string patterns containing the following metacharacters:
-
* zero or more characters @ one or more characters, excluding uppercase letters - Definition["context`*"] prints as the definitions for all symbols in a particular context. »
- Definition["`*"] prints as the definitions for all symbols in the current context. »
- Definition does not show rules associated with symbols that have attribute ReadProtected. »
- Definition has attribute HoldAll. »
Examples
open all close allBasic Examples (2)
Scope (9)
Symbol Inputs (4)
For built-in symbols, Definition gives attributes, defaults and options:
Definition[Information]For user-defined symbols, Definition gives attributes, defaults, options and definitions:
SetAttributes[f, Listable];
Default[f] = 0;
Options[f] = {opt1 -> def1, opt2 -> def2};
f[x_.] := x ^ 2Definition[f]Print the definitions of several symbols:
a = 5;
f[x_] := x ^ 3Definition[{f, a}]Use a combination of symbols and symbol names:
x1 = 1;x2 = 3;x3 = 5;Definition[{x1, "x2"}]Using Patterns (5)
Specify symbols as string patterns:
x1 = 1;x2 = 3;y = 5;Definition["x*"]Get the definitions for all symbols in the current context:
x1 = 1;x2 = 3;y = 5;Definition["`*"]Get the definitions for all symbols in a given context:
abc`x1 = 1;abc`x2 = 3;abc`x3 = 5;Definition["abc`*"]Get the definitions for all 2-character symbols in the current context using StringExpression:
x1 = 1;x2 = 3;y = 5;Definition["`" ~~ _ ~~ _]Get the definitions for all 3-character symbols in the current context using RegularExpression:
x = 1;yy = 3;zzz = 5;Definition[RegularExpression["`..."]]Properties & Relations (6)
For read-protected symbols, definitions are not given:
f[x_] := x ^ 2;
SetAttributes[f, {ReadProtected}]Definition[f]Definition gives attributes, defaults, options and values:
SetAttributes[f, Listable];
Default[f] = 0;
Options[f] = {opt1 -> def1, opt2 -> def2};
f[x_.] := x ^ 2Definition[f]Definition[pattern] gives definitions for the symbols returned by Names[pattern]:
x = 1;y = 2; xy = 3;
Definition["x*"]Definition[Evaluate@Names["x*"]]Definition does not give messages:
f::usage = "f[x] gives (x - 1)(x + 1)";Definition[f]FullDefinition does give messages:
FullDefinition[f]Use Messages to get the messages:
Messages[f]Information returns the values rendered by Definition, as well as usage messages:
Information[Union]?? is the same as Information:
??UnionDefinition has the attribute HoldAll:
Definition[Definition]This gives the definition of symbol itself:
symbol = {"x", "y", "z"};x = 1;y = 3;z = 5;Definition[symbol]This gives the definition of its value:
Definition[Evaluate[symbol]]Possible Issues (3)
Definition is an output form; it does not evaluate:
Definition[Plus]FullForm[%]Definition["symbol"] gives no values if there is no symbol named "symbol":
NameQ["x"]Definition["x"]Definition["symbol"] also gives no values if symbol has no values:
xNameQ["x"]Definition["x"]When using a pattern without a context mark, all definitions for matching symbols on $ContextPath are given:
x = 1;y = 2;xy = 3;
Definition[_ ~~ _]Use a pattern with an explicit context mark to avoid potentially matching symbols from system or other contexts:
Definition["`" ~~ _ ~~ _]See Also
FullDefinition Information DownValues OwnValues UpValues SubValues Attributes Options Default DefaultValues SyntaxInformation
Function Repository: ShowDefinitions
Related Guides
Related Workflows
- Clear Definitions for Symbols and Functions ▪
- Find All Defined Functions
History
Introduced in 1988 (1.0) | Updated in 2022 (13.2)
Text
Wolfram Research (1988), Definition, Wolfram Language function, https://reference.wolfram.com/language/ref/Definition.html (updated 2022).
CMS
Wolfram Language. 1988. "Definition." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2022. https://reference.wolfram.com/language/ref/Definition.html.
APA
Wolfram Language. (1988). Definition. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Definition.html
BibTeX
@misc{reference.wolfram_2026_definition, author="Wolfram Research", title="{Definition}", year="2022", howpublished="\url{https://reference.wolfram.com/language/ref/Definition.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_definition, organization={Wolfram Research}, title={Definition}, year={2022}, url={https://reference.wolfram.com/language/ref/Definition.html}, note=[Accessed: 13-June-2026]}