Skip to content

HoldAll

Status: Stable

documented, exercised by the test suite and/or worked examples, with no known limitations recorded.

Description

HoldAll

is an attribute that specifies that all arguments to a function are to be maintained in an unevaluated form.

Notes You can use Evaluate to evaluate the arguments of a HoldAll function in a controlled way. Even when a function has attribute HoldAll, Sequence objects that appear in its arguments are still by default flattened; Unevaluated wrappers on a held argument are, however, left intact (use HoldComplete/HoldAllComplete to also suppress Sequence flattening).

Examples (4)

Every input below was run against the current Mathilda build and its output recorded.

Basic examples (4)

In[1]:= Hold[1+1, 2+2]
Out[1]= Hold[1 + 1, 2 + 2]

In[2]:= Hold[Sequence[a, b], c]
Out[2]= Hold[a, b, c]

In[3]:= Hold[Unevaluated[1+2]]
Out[3]= Hold[Unevaluated[1 + 2]]

In[4]:= Hold[Evaluate[1+2], 3+4]
Out[4]= Hold[3, 3 + 4]

Implementation notes

Attributes: none registered.

References

See also: SequenceHold, HoldFirst, HoldRest, Hold, HoldForm, HoldPattern, Function