Unicode variable names: Difference between revisions

→‎{{header|Wren}}: Added an alternative using the Var class.
(Omitted EasyLang)
(→‎{{header|Wren}}: Added an alternative using the Var class.)
Line 1,023:
[./unicode_ident line 4] Error: Invalid byte 0xce.
[./unicode_ident line 4] Error: Invalid byte 0x94.
</pre>
 
{{libheader|Wren-trait}}
However, it is possible to simulate Unicode variable names to some extent by using the ''Var'' class in the above module which stores the names (which can be any valid string) in an internal map.
<syntaxhighlight lang="ecmascript">import "./trait" for Var
 
Var["Δ"] = 1
Var["Δ"] = Var["Δ"] + 1
System.print(Var["Δ"])</syntaxhighlight>
 
{{out}}
<pre>
2
</pre>
 
9,477

edits