Unicode variable names: Difference between revisions
Content added Content deleted
No edit summary |
(Added Wren) |
||
Line 917: | Line 917: | ||
=={{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. |
||
=={{header|Wren}}== |
|||
The rules for identifiers are described [http://wren.io/syntax.html here] - basically they can contain letters, digits (not initially) or underscores but identifiers with leading underscores are reserved for field names. |
|||
Although it's perhaps not 100% clear from that description that only ASCII letters and digits are allowed, this in fact is the case as the following example shows. |
|||
The error description refers to the bytes in the UTF encoding of 'Δ' which can't appear (outside a string) in a Wren script. |
|||
<lang ecmascript>var a = 3 |
|||
var b = 2 |
|||
var delta = a - b // ok |
|||
var Δ = delta // not ok</lang> |
|||
{{out}} |
|||
<pre> |
|||
[./unicode_ident line 4] Error: Invalid byte 0xce. |
|||
[./unicode_ident line 4] Error: Invalid byte 0x94. |
|||
</pre> |
|||
=={{header|zkl}}== |
=={{header|zkl}}== |