Unicode variable names: Difference between revisions

m
→‎{{header|Wren}}: Changed to Wren S/H
(Add Zig example)
m (→‎{{header|Wren}}: Changed to Wren S/H)
 
(One intermediate revision by one other user not shown)
Line 318:
 
=={{header|Elena}}==
ELENA 46.x:
<syntaxhighlight lang="elena">public program()
{
Line 324:
Δ := Δ + 1;
console.writeLine:(Δ)
}</syntaxhighlight>
 
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.
<syntaxhighlight lang="ecmascriptwren">var a = 3
var b = 2
var delta = a - b // ok
Line 1,064:
{{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="ecmascriptwren">import "./trait" for Var
 
Var["Δ"] = 1
9,476

edits