The command set
is used to assign values in Tcl. When it is called with two arguments in the following manner,
% set tempVar "This is a string."
This is a string.
it places the second argument ("This is a string.") in the memory space referenced by the first argument (tempVar). set
always returns the contents of the variable named in the first argument. In the above example, set
would return "This is a string." without the quotes.
Note that the name of the variable is not restricted to the Latin alphabet, it may consist of any combination of unicode characters (e.g. Armenian):
% set տուն house
house
% puts ${տուն}
house