interpolate ( str -- quot )


Vocabulary
interpolate

Inputs
stra string


Outputs
None

Word description
String interpolation using named variables and/or stack arguments, writing to the output-stream.

Notes
Stack arguments are numbered from the top of the stack, or provided anonymously by order of arguments.

Examples
USING: interpolate ; "Bob" "Alice" "Hi ${1}, it's ${0}." interpolate
Hi Bob, it's Alice.

USING: interpolate namespaces ; "Fred" "name" [ "Hi ${name}" interpolate ] with-variable
Hi Fred

USING: interpolate ; "Mr." "Anderson" "Hello, ${} ${}" interpolate
Hello, Mr. Anderson


See also
interpolate>string

Definition