"InactiveExpression" (Interpreter Type)
Wolfram Language expression.
Details
- "InactiveExpression" can be used in Interpreter and related constructs, including deployed smart form fields.
- Use of "InactiveExpression" does not require connectivity to the Wolfram Cloud.
- "InactiveExpression" keeps its result unevaluated by wrapping it in Inactivate.
Restriction Specifications
-
Restricted["InactiveExpression",{{choice1,…}}] one among choices Restricted["InactiveExpression",symbols] an expression involving only the given symbols (All, Automatic, or an explicit list) Restricted["InactiveExpression",symbols,contexts] an expression involving only the given symbols or symbols in the given contexts (All, Automatic, or an explicit list) Restricted["InactiveExpression",symbols,contexts,resultcontext] an expression involving only the given symbols or symbols in the given contexts, where the new symbols are created in resultcontext
Interpretation
- "InactiveExpression" yields an Inactive Wolfram Language expression.
Examples
Basic Examples (7)Summary of the most common use cases
Interpret expressions and avoid evaluation:
In[1]:=1
✖
https://wolfram.com/xid/0vli7v98lu0wm48upl7h5uqhe-rae2nv
Out[1]=1
In[2]:=2
✖
https://wolfram.com/xid/0vli7v98lu0wm48upl7h5uqhe-p83p1r
Out[2]=2
No evaluation is attempted when matching the choices:
In[1]:=1
✖
https://wolfram.com/xid/0vli7v98lu0wm48upl7h5uqhe-lds4hl
Out[1]=1
In[2]:=2
✖
https://wolfram.com/xid/0vli7v98lu0wm48upl7h5uqhe-zv5ygj
Out[2]=2
By default, only expressions with no side effect are allowed:
In[1]:=1
✖
https://wolfram.com/xid/0vli7v98lu0wm48upl7h5uqhe-8pjd35
Out[1]=1
This can be changed by allowing All symbols:
In[2]:=2
✖
https://wolfram.com/xid/0vli7v98lu0wm48upl7h5uqhe-2se6b4
Out[2]=2
Restrict to a list of symbols:
In[1]:=1
✖
https://wolfram.com/xid/0vli7v98lu0wm48upl7h5uqhe-gawrvs
Out[1]=1
In[2]:=2
✖
https://wolfram.com/xid/0vli7v98lu0wm48upl7h5uqhe-2dub87
Out[2]=2
By default, new symbols are created in $Context, but a custom context can be specified:
In[1]:=1
✖
https://wolfram.com/xid/0vli7v98lu0wm48upl7h5uqhe-oqr6rm
Out[1]=1
Out[1]=1
In[2]:=2
✖
https://wolfram.com/xid/0vli7v98lu0wm48upl7h5uqhe-u3rgwj
Out[2]=2
Out[2]=2
Specify contexts for the allowed and output symbols:
In[1]:=1
✖
https://wolfram.com/xid/0vli7v98lu0wm48upl7h5uqhe-w4i2l3
Out[1]=1
Prevent the creation of any new symbol:
In[1]:=1
✖
https://wolfram.com/xid/0vli7v98lu0wm48upl7h5uqhe-jvrlf0
Out[1]=1
In[2]:=2
✖
https://wolfram.com/xid/0vli7v98lu0wm48upl7h5uqhe-w1muxn
Out[2]=2