Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Core Language > Defining Variables and Functions > Assignments > UpValues >

UpValues

UpValues[f]
gives a list of transformation rules corresponding to all upvalues defined for the symbol f.
  • You can specify the upvalues for f by making an assignment of the form UpValues[f]=list.
Define upvalues for a symbol :
These are the upvalues associated with :
Define upvalues for a symbol :
In[1]:=
Click for copyable input
These are the upvalues associated with :
In[2]:=
Click for copyable input
Out[2]=
UpValues returns rules corresponding to upvalues defined for a symbol:
UpValues can be used to set the values directly:
Copy a symbol's definitions to another symbol:
HoldPattern is used to protect the rules from their own definitions:
Definition and Information display upvalues but do not return them as values:
UpValues returns a value that can be used in a program:
Evaluation of an expression involves applying matching upvalues:
New in 2 | Last modified in 3
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team
Format:   HTML  |  CDF