HoldComplete
HoldComplete[expr]
shields expr completely from the standard Wolfram Language evaluation process, preventing even upvalues associated with expr from being used.
Details
- HoldComplete allows you to use an expression that has not undergone any evaluation.
- HoldComplete has attribute HoldAllComplete and performs no operations on its arguments.
- HoldComplete is removed by ReleaseHold. »
- HoldComplete[e1,e2,…] maintains a sequence of unevaluated expressions to which a function can be applied using Apply.
- HoldComplete is generated by default by MakeExpression and can be inserted as a wrapper by such functions as ToExpression and Extract. »
- Unlike Hold, HoldComplete[expr] remains unevaluated even if expr is of the form f[args] and upvalues for f have been defined.
Examples
open allclose allBasic Examples (1)
Allow no subexpression to evaluate:
Evaluate the expression by applying ReleaseHold:
Properties & Relations (6)
HoldComplete is the standard container with attribute HoldAllComplete:
No form of evaluation control affects an expression with attribute HoldAllComplete:
Substitution still happens inside HoldComplete:
ReleaseHold removes one level of HoldComplete:
Hold is a milder form of HoldComplete that allows for some form of evaluation:
HoldComplete can be used to freeze the result of ToExpression before it is evaluated:
MakeExpression by default wraps the result in HoldComplete:
Possible Issues (2)
HoldComplete affects only evaluation; input transformations are still applied:
HoldComplete does not prevent formatting:
Add DisableFormatting to prevent formatting:
Text
Wolfram Research (1996), HoldComplete, Wolfram Language function, https://reference.wolfram.com/language/ref/HoldComplete.html.
CMS
Wolfram Language. 1996. "HoldComplete." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/HoldComplete.html.
APA
Wolfram Language. (1996). HoldComplete. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/HoldComplete.html