Unicode variable names: Difference between revisions

Add Zig example
m (Added references for further information.)
(Add Zig example)
Line 1,069:
Var["Δ"] = Var["Δ"] + 1
System.print(Var["Δ"])</syntaxhighlight>
 
{{out}}
<pre>
2
</pre>
 
=={{header|Zig}}==
 
'''Works with:''' 0.10.x, 0.11.x, 0.12.0-dev.1594+7048e9366
 
Links here refer to 0.10.1 documentation, but nothing changed in 0.11.0, and 0.12.0 is not released yet at the moment of writing.
 
Source code in Zig must be encoded in UTF-8, see [https://ziglang.org/documentation/0.10.1/#Source-Encoding this] page from language reference.
 
Zig supports non-conforming identifiers (that includes space, use non-English alphabet, shadow reserved keyword etc.) via @"" syntax. See [https://ziglang.org/documentation/0.10.1/#Identifiers this] page from language reference.
 
<syntaxhighlight lang="zig">const std = @import("std");
 
pub fn main() void {
var @"Δ": i32 = 1;
@"Δ" += 1;
std.debug.print("{d}\n", .{@"Δ"});
}</syntaxhighlight>
 
{{out}}
28

edits