I am a newbie in TCL Programming. I was having confusion about curly braces, answer to this question tcl curly braces cleared most of my doubts.
I can understand $var
, {var}
, and {$var}
, But recently I came across another use of curly braces, ${var}
. How is this interpreted by TCL?
I have seen this is used when accessing variables in namespaces when namespaces name is in variable.
for example:
set x myNamespace ;#myNamespace is name of namespace
puts [set ${x}::var1] ;#var1 is variable in the namespace
It gives error when you don't use curly braces around 'x'.
And I also don't understand the difference between {a b c}
and [list a b c]
, what is the difference in result of interpretation of these two commands by TCL interpretation.
elaborated explanation would be highly appreciated.