tcl脚本学习三: “ ”和{} 的学习

lesson 3

example ①:

set Z "zhou li "
set Z_LABEL "is a boy "

puts " ................. examples of differences between " and {"
puts "$Z_LABEL $Z"
puts {$Z_LABEL $Z}
// {}将会把括号里面的东西全部原封不动的输出

example ②:


puts " ....... examples of differences in nesting { and " "
puts "$Z_LABEL {$Z}"
puts {Who said, "What this country needs is a good $0.05 cigar!"?}
// 第二行可以看出将{$Z}化简即为$Z, 所以第二行结果自然可将$Z所对应的变量输出,而不是直接输出
//第三行是“ 和的嵌套使用: 谁在外面谁就有最终的控制权

原文地址:https://www.cnblogs.com/gold-life/p/5731111.html