WOLFRAM

"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

Conversions

    Expressions

  • Inert expressions are automatically converted to and from expressions when passed between evaluated and compiled code. »

Examples

open allclose all

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

Compile a program that returns an inert expression:

Out[1]=1

Run the program:

Out[2]=2

Inert expressions can be manipulated without being evaluated:

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

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

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

Inert expressions can be evaluated with InertEvaluate:

Out[1]=1