partially format_with«…::=_‡,»

Definitions:

string, <<token, any…|2>…|1..>
Source: /avail/Avail/Foundation/Strings
Categories: Formatting, Strings
Answer the result of partially formatting the specified template using lexically specified format variable bindings. If a format variable does not have a corresponding binding, then re-emit it into the (partially) formatted result.

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: (partially format ‘greeting’, ‘recipient’! with greeting ::= Hello ) = Hello, “recipient”! ; Assert: (partially format (partially format ‘greeting’, ‘recipient’! with greeting ::= Hello ) with recipient ::= world ) = Hello, world! ;

The semantic restriction ensures that every lexically specified binding corresponds to a format variable embedded within the template.

Position Name Type Description
Parameters
1 template string A template string.
2 bindings <<token, any…|2>…|1..> The format variable bindings.
Returns string The result of partially formatting the template usings the specified bindings.

Semantic restrictions:

string's type, <<token, any…|2>…|1..>'s type
Source: /avail/Avail/Foundation/Strings
If the template is statically known, then ensure that 1) each lexical binding references a valid format variable and 2) each format variable that uses the $text interpolation mode is actually bound to a string.
Type Description
Parameter Types
string's type
<<token, any…|2>…|1..>'s type