Unicode variable names: Difference between revisions
Content added Content deleted
Jazzedpineda (talk | contribs) (Omitted EasyLang) |
(→{{header|Wren}}: Added an alternative using the Var class.) |
||
Line 1,023: | Line 1,023: | ||
[./unicode_ident line 4] Error: Invalid byte 0xce. |
[./unicode_ident line 4] Error: Invalid byte 0xce. |
||
[./unicode_ident line 4] Error: Invalid byte 0x94. |
[./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> |
</pre> |
||