Tcl 中的方括号跟大括号

Tcl 中的方括号和大括号
方括号:Tcl 方括号中的代码会被当做表达式(变量,或函数)执行。
大括号:Tcl 中的大括号除了用作分割代码片段外(如 if while 这样的语句需要用大括号),还被用来做字符串表达。与双引号不同的是其中的方括号中的表达式不会被执行。例如:

puts "hello world"

# 报错,因为 hello 将被当做变量名 (如果有 hello 这个变量当然 ok)
puts "[hello] world"

# 正确,方括号会被当做正常字符打印
puts {[hello] world}

# 等同上面,\转义
puts "\[hello\] world"