WOLFRAM

InertExpression
InertExpression

[Experimental]

creates an inert expression in compiled code.

Details

Examples

open allclose all

Basic Examples  (1)Summary of the most common use cases

Compile a program that returns an expression:

Out[1]=1

Run the program:

Out[2]=2

Scope  (4)Survey of the scope of standard use cases

Inert expressions can be manipulated without being evaluated:

Out[1]=1
Out[2]=2

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

Out[1]=1
Out[2]=2

By default, inert expressions are not evaluated:

Out[1]=1
Out[2]=2

InertEvaluate can be used to request evaluation:

Out[3]=3
Out[4]=4

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

Out[1]=1
Out[2]=2

Properties & Relations  (1)Properties of the function, and connections to other functions

Inert expressions can be evaluated with InertEvaluate:

Out[1]=1

Possible Issues  (3)Common pitfalls and unexpected behavior

InertExpression only works in compiled code:

Out[1]=1

Inert expressions may evaluate when returned from compiled code:

Out[1]=1
Out[2]=2

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

Out[3]=3
Out[4]=4

InertExpression does not take compiler variables into account:

Out[1]=1
Out[2]=2
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.

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 ]}

@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 ]}

@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 ]}