"HeldMathExpression" (Interpreter Type)
-
See Also
- Interpreter
- Restricted
- Failure
- HoldComplete
-
- Interpreter Types
- MathExpression
- InactiveMathExpression
- MathFormula
- Expression
- WolframLanguageSymbol
- HeldMathFormula
- InactiveMathFormula
- HeldExpression
- InactiveExpression
- SemanticExpression
- HeldSemanticExpression
- InactiveSemanticExpression
- ComputedWolframLanguageSymbol
- Related Guides
-
-
See Also
- Interpreter
- Restricted
- Failure
- HoldComplete
-
- Interpreter Types
- MathExpression
- InactiveMathExpression
- MathFormula
- Expression
- WolframLanguageSymbol
- HeldMathFormula
- InactiveMathFormula
- HeldExpression
- InactiveExpression
- SemanticExpression
- HeldSemanticExpression
- InactiveSemanticExpression
- ComputedWolframLanguageSymbol
- Related Guides
-
See Also
"HeldMathExpression" (Interpreter Type)
Mathematical expression in natural language.
Details
- "HeldMathExpression" can be used in Interpreter and related constructs, including deployed smart form fields.
- Use of "HeldMathExpression" requires connectivity to the Wolfram Cloud.
- "HeldMathExpression" keeps its result unevaluated by wrapping it in HoldComplete.
Restriction Specifications
-
Restricted["HeldMathExpression",{{choice1,…}}] one among choices Restricted["HeldMathExpression",symbols] an expression involving only the given symbols (All, Automatic, or an explicit list) Restricted["HeldMathExpression",symbols,contexts] an expression involving only the given symbols or symbols in the given contexts (All, Automatic, or an explicit list) Restricted["HeldMathExpression",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
- "HeldMathExpression" yields a Wolfram Language expression wrapped in HoldComplete.
Examples
Basic Examples (6)
Interpret mathematical expressions and avoid evaluation:
Interpreter["HeldMathExpression"]["int sin(y)-iy"]Interpreter["HeldMathExpression"]["1.4x+3"]Interpreter["HeldMathExpression"]["a = b+3"]Find out Wolfram Language representations of natural language queries:
Interpreter["HeldMathExpression"]["second derivative of log x"]No evaluation is attempted when matching the choices:
Interpreter[Restricted["HeldMathExpression", {{1, 2, 3, 4}}]]["two plus one"]Interpreter[Restricted["HeldMathExpression", {{2, HoldComplete[2 + 1]}}]]["two plus one"]By default, new symbols are created in $Context, but a custom context can be specified:
Interpreter[Restricted["HeldMathExpression", All, Automatic, Automatic]]["y + 2"]
Context[y]Interpreter[Restricted["HeldMathExpression", All, Automatic, "mycontext`"]]["k + 2"]
Context[k]Specify contexts for the allowed and output symbols:
mycontext`b = 10;
Interpreter[Restricted["HeldMathExpression", Automatic, {"mycontext`", "System`"}, "mycontext`"]]["a+b"]
Context[a]Prevent the creation of any new symbol:
Interpreter[Restricted["HeldMathExpression", Automatic, Automatic, None]]["3+1"]Interpreter[Restricted["HeldMathExpression", Automatic, Automatic, None]]["z+1"]See Also
Interpreter Restricted Failure HoldComplete
Interpreter Types: MathExpression InactiveMathExpression MathFormula Expression WolframLanguageSymbol HeldMathFormula InactiveMathFormula HeldExpression InactiveExpression SemanticExpression HeldSemanticExpression InactiveSemanticExpression ComputedWolframLanguageSymbol
Related Guides
History
Introduced in 2014 (10.0)