is the low‐level function used in Wolfram System sessions to construct expressions from boxes.
- MakeExpression returns its result wrapped in HoldComplete.
- form can be StandardForm, TraditionalForm, or other forms for which interpretation rules have been defined.
- You can give definitions for MakeExpression[expr,form] to specify your own rules for how boxes should be converted to expressions.
- MakeExpression is not automatically called on the results it generates. This means that explicit MakeExpression calls must typically be inserted into definitions for MakeExpression.
- MakeExpression is used whenever boxes are supplied as input to the Wolfram Language.
- The boxes that are fed to MakeExpression are constructed from textual input by forming tokens, then grouping these according to standard Wolfram Language operator precedence rules, stripping out spacing characters. StyleBox and other objects not intended for interpretation are removed. »
- Definitions you give for MakeExpression will override built‐in Wolfram Language rules for processing input.
- Giving input prefaced by \! makes the Wolfram Language effectively perform MakeExpression.
Examplesopen allclose all
Basic Examples (1)
Convert boxes to an expression using StandardForm rules:
Convert boxes to an expression using TraditionalForm rules:
Convert the same boxes using StandardForm rules:
The display of a box structure with style information:
MakeExpression removes the style information:
Properties & Relations (2)
MakeExpression does not evaluate the expression, while ToExpression does:
Display an InterpretationBox:
The expression is the second argument of the InterpretationBox:
Possible Issues (2)
Input containing invalid or incomplete syntax results in ErrorBox expressions:
The presence of some whitespace can prevent MakeExpression from interpreting a box structure:
Use StripBoxes to strip whitespace and other boxes that interfere with interpretation:
Wolfram Research (1996), MakeExpression, Wolfram Language function, https://reference.wolfram.com/language/ref/MakeExpression.html.
Wolfram Language. 1996. "MakeExpression." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/MakeExpression.html.
Wolfram Language. (1996). MakeExpression. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MakeExpression.html