2015-06-09 Following the Tcl topic of yesterday, Marcus wrote me a message with a Tcl quine: [0] join [split a{a} a] {join [split a{a} a] } To explain it a bit: Tcl splits the line in three words: join [split a{a} a] {join [split a{a} a] } `join' is the command Command substitution is performed on the second word, thus ``split a{a} a'' is replaced by the three-worded list: {"" "{" "}"} The third word is used literally, because it was quoted with braces. Therefore the next step is: join {"" "{" "}"} {join [split a{a} a] } Then, `join' puts the third word between the list elements of the second word, like this: "" {join [split a{a} a] } "{" {join [split a{a} a] } "}" After removing the quotes, the result is what we started from, hence it's a quine. btw: a{a} in Tcl is the same as a'a' in the Bourne shell. The other quine on the mentioned website is even more impressive: join {{} \{ \}} {join {{} \{ \}} } It uses the same principle, but without the split detour and with more braces. ;-) [0] http://www.nyx.net/~gthompso/self_tcl.txt http://marmaro.de/lue/ markus schnalke