A dollar sign together with an immediately following variable name will be substituted by the value of the variable. $var is thus the same as set var. This is important for dereferencing: if the value of a variable is the name of another variable, e.g.
we cannot obtain the value of b using the variable substitution on a, using something like $$a. Instead, the set command can be used:% set a b b % set b 1 1
% set $a 1
Note that it does not matter if the dollar sign is preceded by a word separator, so it is possible to create new variable names dynamically:
% set a abc abc % set b$a 1 1 % puts $babc 1