TemplateExpression

TemplateExpression[expr]

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

Details and Options

Examples

open allclose all

Basic Examples  (1)

Prevent evaluation until a template is applied:

Options  (1)

InsertionFunction  (1)

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

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

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

Properties & Relations  (1)

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

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:

Introduced in 2014
 (10.0)