Evaluate
Usage Message: Evaluate[expr] causes expr to be evaluated even if it appears as the argument of a function whose
attributes specify that it should be held unevaluated. Attributes[Evaluate] = {Protected}
Related Symbols: Hold
HoldAll
HoldFirst
HoldRest
ReleaseHold
SetAttributes
Unevaluated
Notes: Evaluate is used to override the effects of HoldAll
, HoldFirst
, and HoldRest
. Evaluate forces evaluation when it is the head of an element that would otherwise be held unevaluated due the effect of one of these attributes.
In[1]:= SetAttributes[f, HoldAll]
In[2]:= f[Evaluate[2 + 2], 2 + 2]
Out[2]= f[4, 2 + 2]
The most common use of Evaluate is in forcing evaluation of arguments in built-in functions that hold their elements unevaluated. For example, Evaluate is used in
Plot[Evaluate[Table[ChebyshevT[n,x],{n,1,8}]],{x,-1,1}]
to override the effect of the HoldAll
attribute of Plot
. In this example, Evaluate causes the Table
expression to evaluate to a list, so that Plot
will know to plot more than one function.
Additional Online Documentation:
Mathematica 3.0
http://documents.wolfram.com/v3/RefGuide/Evaluate.html
Mathematica 4.0
http://documents.wolfram.com/v4/RefGuide/Evaluate.html
Questions or comments? Send email to support@wolfram.com.
| |