1 ! Copyright (C) 2008 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: interpolate io.streams.string namespaces tools.test locals ;
6 { "A B" } [ "A" "B" "${0} ${1}" interpolate ] unit-test
7 { "B A" } [ "A" "B" "${1} ${0}" interpolate ] unit-test
8 { "C A" } [ "A" "B" "C" "${2} ${0}" interpolate ] unit-test
12 "Hello, ${name}." interpolate
17 "Mr." "${0} ${name}" interpolate
20 { "Sup Dawg, we heard you liked rims, so we put rims on your rims so you can roll while you roll." } [
24 "Sup ${name}, we heard you liked ${noun}, so we put ${noun} on your ${noun} so you can ${verb} while you ${verb}." interpolate
27 { "Oops, I accidentally the whole economy..." } [
30 "accidentally" [ I[ Oops, I ${0} the whole ${noun}...]I ] with-string-writer