Idiomatically determine all the characters that can be used for symbols: Difference between revisions

m
→‎{{header|Tcl}}: Added some notes
(→‎Tcl: Added implementation)
m (→‎{{header|Tcl}}: Added some notes)
Line 105:
 
=={{header|Tcl}}==
Tcl permits ''any'' character to be used in a variable or command name (subject to the restriction that <code>::</code> is a namespace separator and, for variables only, a <code>(…)</code> sequence is an array reference). The set of characters that can be used after <code>$</code> is more restricted, excluding many non-letter-like symbols, but still large. It is ''recommended practice'' to only use ASCII characters for variable names as this makes scripts more resistant to the majority of encoding problems when transporting them between systems, but the language does not itself impose such a restriction.
<lang tcl>for {set c 0;set printed 0;set special {}} {$c <= 0xffff} {incr c} {
set ch [format "%c" $c]
Anonymous user