MACRO: interpolate ( string -- ) [EBNF var = "${" [^}]+ "}" => [[ second >string [ get present write ] curry ]] text = [^$]+ => [[ >string [ write ] curry ]] interpolate = (var|text)* => [[ [ ] join ]] EBNF] ; ! Example ( scratchpad ) "a" "x" set ( scratchpad ) "hello" "y" set ( scratchpad ) "test ${x} and ${y}\n" interpolate test a and hello