| |
双引号和花括号用来将单词组合到一起,形成一个参数。双引号和花括号的差别在于双引号允许组内替代,而花括号不允许。该规则适用于命令替代,变量替代和反斜杠替代。
(System32) 1 % set s hello
hello
(System32) 2 % puts "The length of $s is [string length $s]"
The length of hello is 5
(System32) 3 % puts {The length of $s is [string length $s]}
The length of $s is [string length $s]