Open Akuli opened 3 years ago
can variable names contain dashes in other situations?
Not when accessed with $var
notation, but they can be used in other ways. If you have a variable named foo-bar
, you can access it with set foo-bar
or ${foo-bar}
:
$ tclsh
% set foo-bar 123
123
% puts $foo-bar
can't read "foo": no such variable
% puts ${foo-bar}
123
% set foo-bar
123
This prints
a-lol-b
, treatingfoo
as a variable name, but Pygments highlight this as iffoo-b
was a variable name: