WOLFRAM

represents an expression held until a template is applied, and then evaluated.

Details and Options

Examples

open allclose all

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

Prevent evaluation until a template is applied:

Out[1]=1
Out[2]=2
Out[3]=3

Options  (1)Common values & functionality for each option

InsertionFunction  (1)

Use InsertionFunction to specify a function to apply before the TemplateExpression is inserted:

Out[1]=1

The default value of Inherited causes the InsertionFunction to be inherited from any containing template constructs:

Out[2]=2

Specifying an InsertionFunction for the TemplateExpression overrides the value inherited from other constructs:

Out[3]=3

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

Functions like StringTemplate generate a TemplateObject that specifies an appropriate InsertionFunction. This InsertionFunction is then inherited by constructs such as TemplateExpression:

Out[1]=1

TemplateExpression[expr] will not evaluate expr before inserting the result into the template, independent of whether evaluation would normally occur in that part of the result:

Out[2]=2
Wolfram Research (2014), TemplateExpression, Wolfram Language function, https://reference.wolfram.com/language/ref/TemplateExpression.html.
Wolfram Research (2014), TemplateExpression, Wolfram Language function, https://reference.wolfram.com/language/ref/TemplateExpression.html.

Text

Wolfram Research (2014), TemplateExpression, Wolfram Language function, https://reference.wolfram.com/language/ref/TemplateExpression.html.

Wolfram Research (2014), TemplateExpression, Wolfram Language function, https://reference.wolfram.com/language/ref/TemplateExpression.html.

CMS

Wolfram Language. 2014. "TemplateExpression." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/TemplateExpression.html.

Wolfram Language. 2014. "TemplateExpression." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/TemplateExpression.html.

APA

Wolfram Language. (2014). TemplateExpression. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/TemplateExpression.html

Wolfram Language. (2014). TemplateExpression. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/TemplateExpression.html

BibTeX

@misc{reference.wolfram_2025_templateexpression, author="Wolfram Research", title="{TemplateExpression}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/TemplateExpression.html}", note=[Accessed: 29-March-2025 ]}

@misc{reference.wolfram_2025_templateexpression, author="Wolfram Research", title="{TemplateExpression}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/TemplateExpression.html}", note=[Accessed: 29-March-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_templateexpression, organization={Wolfram Research}, title={TemplateExpression}, year={2014}, url={https://reference.wolfram.com/language/ref/TemplateExpression.html}, note=[Accessed: 29-March-2025 ]}

@online{reference.wolfram_2025_templateexpression, organization={Wolfram Research}, title={TemplateExpression}, year={2014}, url={https://reference.wolfram.com/language/ref/TemplateExpression.html}, note=[Accessed: 29-March-2025 ]}