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.
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.
Details
- By setting the attribute HoldAllComplete, you can effectively shield the arguments of a function from all aspects of the standard Wolfram Language evaluation process.
- HoldAllComplete not only prevents arguments from being evaluated, but also prevents Sequence objects from being flattened, Unevaluated wrappers from being stripped, and upvalues associated with arguments from being used.
- Evaluate cannot be used to override HoldAllComplete.
Examples
open all close allBasic Examples (1)
Attributes[HoldComplete]HoldComplete[1 + 1, Evaluate[1 + 2], Sequence[3, 4]]Properties & Relations (4)
HoldComplete is a standard container with attribute HoldAllComplete:
Attributes[HoldComplete]HoldComplete[Sequence[a, b], 1 + 2]No form of evaluation control affects an expression with attribute HoldAllComplete:
HoldComplete[1 + 2]HoldComplete[Evaluate[1 + 2]]HoldComplete[Sequence[a, b]]g/:HoldComplete[g[x_]] := xHoldComplete[g[1]]Substitution still happens inside an expression with attribute HoldAllComplete:
HoldComplete[f[1 + 2]] /. f[x_] :> g[x]Unevaluated has the attribute HoldAllComplete:
Length[Unevaluated[Sequence[a, b]]]Possible Issues (2)
HoldAllComplete affects only evaluation; input transformations are still applied:
FullForm[HoldComplete[a - b, a / b]]HoldAllComplete does not prevent formatting:
HoldComplete[Grid[{{1, 2}, {3, 4}}]]Add DisableFormatting to prevent formatting:
HoldComplete[DisableFormatting[Grid[{{1, 2}, {3, 4}}]]]Neat Examples (1)
A fast way to compute the Hofstadter–Conway sequence [more info]:
SetAttributes[h, HoldAllComplete];
hc[m_Integer /; m ≥ 1] :=
Module[{a = h@@Table[0, {m}], i},
a[[1]] = 1;
Do[a[[i]] = a[[a[[i - 1]]]] + a[[i - a[[i - 1]]]], {i, 2, m}];
a[[m]]
]Timing[hc[5 10 ^ 5]]Tech Notes
Related Guides
Related Workflows
- Substitute Values of Variables in Functions That Hold Their Arguments
History
Introduced in 1996 (3.0)
Text
Wolfram Research (1996), HoldAllComplete, Wolfram Language function, https://reference.wolfram.com/language/ref/HoldAllComplete.html.
CMS
Wolfram Language. 1996. "HoldAllComplete." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/HoldAllComplete.html.
APA
Wolfram Language. (1996). HoldAllComplete. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/HoldAllComplete.html
BibTeX
@misc{reference.wolfram_2026_holdallcomplete, author="Wolfram Research", title="{HoldAllComplete}", year="1996", howpublished="\url{https://reference.wolfram.com/language/ref/HoldAllComplete.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_holdallcomplete, organization={Wolfram Research}, title={HoldAllComplete}, year={1996}, url={https://reference.wolfram.com/language/ref/HoldAllComplete.html}, note=[Accessed: 13-June-2026]}