Hold is a container with the attribute
HoldAll:
Functions that operate on symbols often need the
HoldAll attribute:
Without the attribute, they would operate on the symbol's value:
Control structures such as
Table protect their arguments from evaluation:
Otherwise, global values might interfere with their operation:
Use
Evaluate to force evaluation of an argument of a
HoldAll function:
Force evaluation of the right-hand side of a delayed definition:
Use
Unevaluated to temporarily treat a function as if it had the attribute
HoldAll:
Unevaluated inside a held expression is not removed:
This is the full form of the evaluation result:
This is the full form of the input, before evaluation:
Suppress the evaluation of the arguments of a pure function:
Sequence splicing still happens for
HoldAll functions:
Use the container
HoldComplete to suppress even such transformations:
The attribute that causes this behavior is
HoldAllComplete:
Substitution works inside a held expression:
Insert into a held expression:
NHoldAll protects arguments from
N, but evaluates them normally otherwise:
HoldPattern protects patterns from evaluation, but does not interfere with pattern matching: