Unicode variable names: Difference between revisions

Content added Content deleted
m (→‎{{header|AppleScript}}: Minor edit to allow correction of summary. It's not ASObjC. The site's autofill must have got overexcited.)
No edit summary
Line 979: Line 979:
It is also possible to encode characters using a <tt>\u''XXXX''</tt> substitution (each <tt>''X''</tt> is a hexadecimal digit), thus the <code>Δx</code> could be replaced throughout above by <code>\u0394x</code>; the result is a variable with exactly the same name as before. Doing this allows a script to be written with just ASCII characters, which tends to maximize portability across platforms.
It is also possible to encode characters using a <tt>\u''XXXX''</tt> substitution (each <tt>''X''</tt> is a hexadecimal digit), thus the <code>Δx</code> could be replaced throughout above by <code>\u0394x</code>; the result is a variable with exactly the same name as before. Doing this allows a script to be written with just ASCII characters, which tends to maximize portability across platforms.


=={{header|UNIX Shell}}==
{{works with|zsh}}
<lang bash>
Δ=1
Δ=`expr $Δ + 1`
echo $Δ
</lang>
{{out}}
<pre>2</pre>
=={{header|Vala}}==
=={{header|Vala}}==
Vala has limited support for Unicode in variable names. This limitation comes from its source-to-source compilation to C.
Vala has limited support for Unicode in variable names. This limitation comes from its source-to-source compilation to C.
Line 1,049: Line 1,058:
{{omit from|TUSCRIPT}}
{{omit from|TUSCRIPT}}
{{omit from|Unicon}}
{{omit from|Unicon}}
{{omit from|UNIX Shell}}
{{omit from|Z80 Assembly|Depends on the assembler, and variable names don't exist at runtime anyway.}}
{{omit from|Z80 Assembly|Depends on the assembler, and variable names don't exist at runtime anyway.}}
{{omit from|ZX Spectrum Basic}}
{{omit from|ZX Spectrum Basic}}