format_with_

Definitions:

string, {string→any|}
Source: /avail/Avail/Foundation/Strings
Categories: Formatting, Strings
Answer the result of fully formatting the specified template using format variable bindings contained in the given map. The map must contain bindings for all variables embedded within the template.

A template intermixes raw character data with format variable interpolation sites. An interpolation site begins with either the ¢‘ or ¢“ metacharacter and ends with the corresponding close metacharacter, either ¢’ or ¢”, respectively. An interpolation site may contain any character except the expected close metacharacter. The contents are understood to name a variable that may appear as a key within the specified map; the associated value is this variable's value. If an interpolation site uses ¢“ (and ¢”), then the value will be converted to a string via `“_”` when it is copied into the result. If an interpolation site uses ¢‘ (and ¢’), then the value must be a string and will be copied directly into the result. To escape a metacharacter, precede it immediately by ¢`.

For example:

Assert: format ‘greeting’, ‘recipient’! with { greeting →"Hello", recipient →"world" = Hello, world! ;}

Position Name Type Description
Parameters
1 template string A template string.
2 vars {string→any|} A map from format variables to their bindings. This map must include a binding for every variable mentioned within the template.
Returns string The result of formatting the template usings the specified bindings.

Semantic restrictions:

string's type, {string→any|}'s type
Source: /avail/Avail/Foundation/Strings
Type Description
Parameter Types
string's type
{string→any|}'s type