gives a list of transformation rules corresponding to all subvalues (values for f[][]) defined for the symbol f.

Details and Options

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


open allclose all

Basic Examples  (1)

Define subvalues for a symbol f:

These are the subvalues associated with f:

Scope  (3)

SubValues returns rules corresponding to subvalues defined for a symbol:

SubValues can be defined for heads of any depth:

SubValues can be used to set the values directly:

Applications  (3)

Create a data object for properties that can be extracted:

These definitions are stored as SubValues:

Extract all the properties from a given object:

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:

Without the HoldPattern, the left-hand side would have evaluated:

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

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

Evaluation of an expression involves applying matching subvalues:

Wolfram Research (1991), SubValues, Wolfram Language function, (updated 1996).


Wolfram Research (1991), SubValues, Wolfram Language function, (updated 1996).


Wolfram Language. 1991. "SubValues." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 1996.


Wolfram Language. (1991). SubValues. Wolfram Language & System Documentation Center. Retrieved from


@misc{reference.wolfram_2021_subvalues, author="Wolfram Research", title="{SubValues}", year="1996", howpublished="\url{}", note=[Accessed: 21-May-2022 ]}


@online{reference.wolfram_2021_subvalues, organization={Wolfram Research}, title={SubValues}, year={1996}, url={}, note=[Accessed: 21-May-2022 ]}