13.32.6 Quotes and Braces
The distinction between braces ({ }) and quotes (" ") is significant when the list
contains references to variables. When references are enclosed in quotes, they are substituted
with values. However, when references are enclosed in braces, they are not substituted with
values. For example, see this below table.
| With Braces | With Double Quotes |
|---|---|
|
set b 2 |
set b 2 |
|
set t { 1 $b 3 } |
set t " 1 $b 3 " |
|
set s { [ expr $b + $b ] } |
set s " [ expr $b + $b ] " |
|
puts stdout $t |
puts stdout $t |
|
puts stdout $s |
puts stdout $s |
will output
1 $b 3 vs. 1 2 3
[ expr $b + $b ] 4