Unicode variable names: Difference between revisions

Content added Content deleted
imported>Arakov
m (→‎{{header|Wren}}: Changed to Wren S/H)
Line 1,051: Line 1,051:


The error description refers to the bytes in the UTF encoding of 'Δ' which can't appear (outside a string) in a Wren script.
The error description refers to the bytes in the UTF encoding of 'Δ' which can't appear (outside a string) in a Wren script.
<syntaxhighlight lang="ecmascript">var a = 3
<syntaxhighlight lang="wren">var a = 3
var b = 2
var b = 2
var delta = a - b // ok
var delta = a - b // ok
Line 1,064: Line 1,064:
{{libheader|Wren-trait}}
{{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.
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
<syntaxhighlight lang="wren">import "./trait" for Var


Var["Δ"] = 1
Var["Δ"] = 1