-
See Also
- InertEvaluate
- Construct
- KernelFunction
- KernelEvaluate
- Hold
- Inactive
-
- Compiled Types
- InertExpression
-
-
See Also
- InertEvaluate
- Construct
- KernelFunction
- KernelEvaluate
- Hold
- Inactive
-
- Compiled Types
- InertExpression
-
See Also
InertExpression[expr]
creates an inert expression in compiled code.
InertExpression[head][e1,e2,…]
creates an inert expression with head and arguments ei.


InertExpression
InertExpression[expr]
creates an inert expression in compiled code.
InertExpression[head][e1,e2,…]
creates an inert expression with head and arguments ei.
Details

- InertExpression is only available in compiled code.
- expr must be a constant value and must not contain any references to compiler variables. »
- InertExpression[expr] returns an object with the type "InertExpression".
- "InertExpression" objects returned by InertExpression are inert and will only evaluate on calls to InertEvaluate. »
- In InertExpression[head][e1,e2,…], the ei can be general compiler elements that are computed with compiled code and then converted into inert expressions.
Examples
open all close allBasic Examples (1)
Compile a program that returns an expression:
Compile a program that uses InertExpression as a head to construct a new expression:
Compile a program that uses InertExpression as a head to construct a new expression with an element converted from an integer:
Scope (5)
Inert expressions can be manipulated without being evaluated:
Construct an inert expression, wrapping it in Hold before returning from compiled code:
By default, inert expressions are not evaluated:
InertEvaluate can be used to request evaluation:
Inert expressions are automatically converted to expressions and evaluated when returned from compiled code:
Inert expressions do not evaluate:
When inert expressions are constructed from non-inert arguments, the latter will evaluate:
Properties & Relations (1)
Inert expressions can be evaluated with InertEvaluate:
Possible Issues (3)
InertExpression only works in compiled code:

Inert expressions may evaluate when returned from compiled code:
Wrap inert expressions in Hold before returning to prevent them from being evaluated:
InertExpression does not take compiler variables into account:
The compiler variable can be passed as an argument and not inside the InertExpression wrapper:
See Also
InertEvaluate Construct KernelFunction KernelEvaluate Hold Inactive
Compiled Types: InertExpression
Text
Wolfram Research (2022), InertExpression, Wolfram Language function, https://reference.wolfram.com/language/ref/InertExpression.html (updated 2025).
CMS
Wolfram Language. 2022. "InertExpression." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2025. https://reference.wolfram.com/language/ref/InertExpression.html.
APA
Wolfram Language. (2022). InertExpression. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/InertExpression.html
BibTeX
@misc{reference.wolfram_2025_inertexpression, author="Wolfram Research", title="{InertExpression}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/InertExpression.html}", note=[Accessed: 15-August-2025]}
BibLaTeX
@online{reference.wolfram_2025_inertexpression, organization={Wolfram Research}, title={InertExpression}, year={2025}, url={https://reference.wolfram.com/language/ref/InertExpression.html}, note=[Accessed: 15-August-2025]}