З книжки „Tcl and the Tk Toolkit (2nd Edition)“, John K. Ousterhout & Ken Jones:
…Tcl parser doesn’t apply any meaning to the words of a command while it parses them. All of the preceding meanings are applied by
individual command procedures, not by the Tcl parser. This approach is similar to that of most shell languages but different from most programming languages. For example, consider the following C program code:
x = 4;
y = x+10;
In the first statement C stores the integer value 4 in variable x. In the second statement C evaluates the expression x+10 , fetching the value of variable x and adding 10 , and stores the result in variable y . At the end of execution, y has the integer value 14 . If you want to use a literal string in C without evaluation, you must enclose it in quotes. Now consider a similar looking program written in Tcl:
set x 4
set y x+10
The first command assigns the string 4 to variable x. The value of the variable need not have any particular form. The second command simply takes the string x+10 and stores it as the new value for y. At the end of the script, y has the string value x+10, not the integer value 14. In Tcl, if you want evaluation you must ask for it explicitly:
set x 4
set y [expr $x+10]
Evaluation is requested twice in the second command. First, the second word of the command is enclosed in brackets, which tells the Tcl parser to evaluate the characters between the brackets as a Tcl script and use the result as the value of the word. Second, a dollar sign has been placed before x. When Tcl parses the expr command, it substitutes the value of variable x for the $x. If the dollar sign were omitted, expr ’s argument would contain the string x, resulting in a syntax error. At the end of the script, y has the string value 14.
Виглдаяє цікаво, але незрозуміло як до такого хтось міг додуматися, нащо так писати і в чому смисл.