HoldAllComplete
Usage Message: HoldAllComplete is an attribute which specifies that all arguments to a function are not to be
modified or looked at in any way in the process of evaluation. Attributes[HoldAllComplete] = {Protected}
Related Symbols: Attributes
ClearAttributes
Evaluate
Hold
HoldAll
HoldComplete
HoldFirst
HoldRest
SequenceHold
SetAttributes
Unevaluated
Notes: The HoldAllComplete is used to prevent all evaluation transformations in an expression. The difference between the
HoldAllComplete attribute and the HoldAll
attribute is that the HoldAll
attribute does allow some evaluation transformations. Specifically, HoldAll
allows certain types of evaluation rules to be applied (see UpValues
, UpSet
, and UpSetDelayed
), it allows Sequence
to be spliced into the enclosing function, and it allows Evaluate
for force evaluation of expression of expression elements.
In[1]:= SetAttributes[h, HoldAll]
In[2]:= h[f[2 + 2]]
Out[2]= h[f[2 + 2]]
In[3]:= h[f[p_]] ^:= f[p]
In[4]:= h[f[2 + 2]]
Out[4]= f[4]
In[5]:= h[Sequence[x, y, z]]
Out[5]= h[x, y, z]
In[6]:= h[Evaluate[2 + 2]]
Out[6]= h[4]
The HoldAllComplete attribute prevents these transformations.
In[7]:= SetAttributes[h, HoldAllComplete]
In[8]:= h[f[2 + 2]]
Out[8]= h[f[2 + 2]]
In[9]:= h[Sequence[x, y, z]]
Out[9]= h[Sequence[x, y, z]]
In[10]:= h[Evaluate[2 + 2]]
Out[10]= h[Evaluate[2 + 2]]
Additional Online Documentation:
Mathematica 3.0
http://documents.wolfram.com/v3/RefGuide/HoldAllComplete.html
Mathematica 4.0
http://documents.wolfram.com/v4/RefGuide/HoldAllComplete.html
Questions or comments? Send email to support@wolfram.com.
|