InertExpression
✖
InertExpression
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. »
Examples
open allclose allBasic Examples (1)Summary of the most common use cases
Scope (4)Survey of the scope of standard use cases
Inert expressions can be manipulated without being evaluated:

https://wolfram.com/xid/0g7heef4osy-5cvmqz


https://wolfram.com/xid/0g7heef4osy-5uhmly

Construct an inert expression, wrapping it in Hold before returning from compiled code:

https://wolfram.com/xid/0g7heef4osy-fsxqav


https://wolfram.com/xid/0g7heef4osy-scc11p

By default, inert expressions are not evaluated:

https://wolfram.com/xid/0g7heef4osy-pnvkiu


https://wolfram.com/xid/0g7heef4osy-y4cjf0

InertEvaluate can be used to request evaluation:

https://wolfram.com/xid/0g7heef4osy-5e28eb


https://wolfram.com/xid/0g7heef4osy-c6vvkg


Inert expressions are automatically converted to expressions and evaluated when returned from compiled code:

https://wolfram.com/xid/0g7heef4osy-0c6d6g


https://wolfram.com/xid/0g7heef4osy-s21uny


Properties & Relations (1)Properties of the function, and connections to other functions
Inert expressions can be evaluated with InertEvaluate:

https://wolfram.com/xid/0g7heef4osy-z6opbb

Possible Issues (3)Common pitfalls and unexpected behavior
InertExpression only works in compiled code:

https://wolfram.com/xid/0g7heef4osy-6iq55i


Inert expressions may evaluate when returned from compiled code:

https://wolfram.com/xid/0g7heef4osy-07sfzq


https://wolfram.com/xid/0g7heef4osy-cncwfx

Wrap inert expressions in Hold before returning to prevent them from being evaluated:

https://wolfram.com/xid/0g7heef4osy-xe41gh


https://wolfram.com/xid/0g7heef4osy-opwlxd

InertExpression does not take compiler variables into account:

https://wolfram.com/xid/0g7heef4osy-vb89nn


https://wolfram.com/xid/0g7heef4osy-bh34gd

Wolfram Research (2022), InertExpression, Wolfram Language function, https://reference.wolfram.com/language/ref/InertExpression.html.
Text
Wolfram Research (2022), InertExpression, Wolfram Language function, https://reference.wolfram.com/language/ref/InertExpression.html.
Wolfram Research (2022), InertExpression, Wolfram Language function, https://reference.wolfram.com/language/ref/InertExpression.html.
CMS
Wolfram Language. 2022. "InertExpression." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/InertExpression.html.
Wolfram Language. 2022. "InertExpression." Wolfram Language & System Documentation Center. Wolfram Research. 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
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="2022", howpublished="\url{https://reference.wolfram.com/language/ref/InertExpression.html}", note=[Accessed: 25-April-2025
]}
BibLaTeX
@online{reference.wolfram_2025_inertexpression, organization={Wolfram Research}, title={InertExpression}, year={2022}, url={https://reference.wolfram.com/language/ref/InertExpression.html}, note=[Accessed: 25-April-2025
]}