'''`[ycl] string expand`''' is a [Template and Macro processing%|%macro system] that replaces substrings in a string by iteratively replacing lists nested in a substring itself with items from the list. The idea is to keep the source code readable while minimizing literal repetition. ====== set a {one two three} set b {four five six} if 1 [expand { [@ foreach list [* $a $b *] { foreach item $list { lappend res $item } } @] }] set res ;# -> {one two three four five six} ====== <> ycl