"InertExpression" (Compiled Type)
[Experimental]
"InertExpression"
represents an inert expression that is not automatically evaluated.
Details
- "InertExpression" can be used in Typed and related constructs to specify a type.
- "InertExpression" objects are automatically memory managed.
- "InertExpression" objects are internally represented identically to Wolfram Language expressions.
- "InertExpression" objects are inert and will only evaluate on calls to InertEvaluate.
Constructors
- InertExpression[expr] constructs an inert expression object from the constant expr.
- Construct[head,expr1,expr2,…] combines the inert expressions head,expr1,expr2,… to construct head[expr1,expr2,…] as an inert expression. »
Properties
- InertEvaluate evaluates an inert expression. »
Conversions
- Inert expressions are automatically converted to and from expressions when passed between evaluated and compiled code. »
Expressions
Examples
open allclose allBasic Examples (2)Summary of the most common use cases
Compile a program that returns an inert expression:
In[1]:=1

✖
https://wolfram.com/xid/0hrpt1yjviazrxjs49zpc1xe7vki-xjtcvy
Out[1]=1

In[2]:=2

✖
https://wolfram.com/xid/0hrpt1yjviazrxjs49zpc1xe7vki-2pd3lf
Out[2]=2

Inert expressions can be manipulated without being evaluated:
In[1]:=1

✖
https://wolfram.com/xid/0hrpt1yjviazrxjs49zpc1xe7vki-5cvmqz
Out[1]=1

In[2]:=2

✖
https://wolfram.com/xid/0hrpt1yjviazrxjs49zpc1xe7vki-5uhmly
Out[2]=2

Scope (2)Survey of the scope of standard use cases
Inert expressions are automatically converted to expressions and evaluated when returned from compiled code:
In[1]:=1

✖
https://wolfram.com/xid/0hrpt1yjviazrxjs49zpc1xe7vki-0c6d6g
Out[1]=1

In[2]:=2

✖
https://wolfram.com/xid/0hrpt1yjviazrxjs49zpc1xe7vki-s21uny

Out[2]=2

Construct an inert expression, wrapping it in Hold before returning from compiled code:
In[1]:=1

✖
https://wolfram.com/xid/0hrpt1yjviazrxjs49zpc1xe7vki-fsxqav
Out[1]=1

In[2]:=2

✖
https://wolfram.com/xid/0hrpt1yjviazrxjs49zpc1xe7vki-scc11p
Out[2]=2

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

✖
https://wolfram.com/xid/0hrpt1yjviazrxjs49zpc1xe7vki-z6opbb
Out[1]=1
