Unicode variable names: Difference between revisions
m
→{{header|Wren}}: Changed to Wren S/H
(Updated link to documentation. Changed syntax to a somewhat more readable one (arguable point).) |
m (→{{header|Wren}}: Changed to Wren S/H) |
||
(24 intermediate revisions by 18 users not shown) | |||
Line 16:
{{trans|Python}}
<
Δx++
print(Δx)</
{{out}}
Line 34:
-- [http://8th-dev.com/local.html Writing localized applications with 8th]
<
1 var, Δ
Line 55:
الوداع
</syntaxhighlight>
=={{header|ACL2}}==
Variables in ACL2 cannot be modified in place.
<
(1+ Δ))</
=={{header|Ada}}==
As of Ada 2005, all source code can be made of up to 32bit characters.
Unless you have made it a default, GNAT would require the -gnatW8 flag to understand you are using UTF8 for the code below, other encodings are possible.
<
procedure main is
Δ : Integer;
Line 72:
Δ := Δ + 1;
Ada.Text_IO.Put_Line (Δ'Img);
end main;</
{{out}}
<pre> 42</pre>
Line 104:
''Russian/Soviet example: In English Algol68's reverent case statement reads '''case''' ~ '''in''' ~ '''out''' ~ '''esac''', in Cyrillic this reads '''выб''' ~ '''в''' ~ '''либо''' ~ '''быв'''.''
=={{header|AppleScript}}==
In AppleScript, identifiers whose first and last characters are vertical bars (|) can contain any characters. The AppleScript Language Guide doesn't recommend their use as they can make scripts difficult to read, but they're perfectly legal.
<syntaxhighlight lang="applescript">set |Δ| to 1
set |Δ| to |Δ| + 1
return |Δ|</syntaxhighlight>
{{output}}
<syntaxhighlight lang="applescript">2</syntaxhighlight>
Vertical bars can also be used to differentiate between identifiers and reserved words should the need arise. The bars are just a signal to the compiler to accept what's between them as an identifier and aren't stored with the identifier itself. They may disappear once the code's compiled if the decompiler can't see a reason to include them. Or indeed they may be added if a script compiled on one machine is decompiled on another where one of the identifiers clashes with a term defined in a library or OSAX installed on that machine.
=={{header|Arturo}}==
Arturo doesn't support words with non-ASCII characters.
However, you can set/get a variable with any name defined as a Unicode string, using the functions <code>let</code> (or its alias <code>:</code>) and <code>var</code>.
<syntaxhighlight lang="rebol">"Δ": 1
"Δ": inc var "Δ"
print ["Delta =>" var "Δ"]</syntaxhighlight>
{{out}}
<pre>Delta => 2</pre>
=={{header|AutoHotkey}}==
Line 109 ⟶ 137:
Documentation: http://www.autohotkey.net/~Lexikos/AutoHotkey_L/docs/Variables.htm
{{works with|AutoHotkey_L}}
<
Δ++
MsgBox, % Δ</
=={{header|BaCon}}==
This is a port from the C example. As mentioned there, C has limited support for Unicode variable names which is specified in the C standard, and BaCon, being a Basic-to-C converter, therefore has the same restrictions. The below example works with the CLang compiler.
<
DECLARE Δ TYPE int
Line 123 ⟶ 151:
INCR Δ
PRINT Δ</
{{out}}
<pre>
Line 137 ⟶ 165:
=={{header|Bracmat}}==
Bracmat allows any sequence of non-zero bytes as symbol and therefore, as variable name. Even the empty string is a variable, though a special one. If a symbol/variable name contains characters that have special meaning (operators, prefixes, parentheses, braces and the semicolon) it may be necessary to enclose it in quotes. Other special characters must be escaped C-style. See bracmat.html in the git-repo. The example below requires a terminal that supports UTF-8 encoded characters.
<
& 1+!Δ:?Δ
& out$("Δ:" !Δ)
);</
Output:
<pre>Δ: 2</pre>
Line 149 ⟶ 177:
Most modern compilers, as of 2020, support raw Unicode identifiers, given the file is encoded properly (typically UTF-8).
<
#include<stdio.h>
Line 157 ⟶ 185:
printf("%d",Δ);
return 0;
}</
Output:
<pre>
Line 165 ⟶ 193:
=={{header|C sharp|C#}}==
Section 2.4.2 of the [http://go.microsoft.com/fwlink/?LinkId=199552 C# Language Specification] gives rules for identifiers. They correspond exactly to those recommended by the [http://unicode.org/reports/tr31/ Unicode Standard Annex 31], except that underscore is allowed as an initial character (as is traditional in the C programming language), Unicode escape sequences are permitted in identifiers, and the "@" character is allowed as a prefix to enable keywords to be used as identifiers.
<
{
static void Main()
Line 173 ⟶ 201:
System.Console.WriteLine(Δ);
}
}</
{{out}}
<pre>2</pre>
=={{header|C++}}==
The C++ language allows the use of Unicode variable names.
For more information visit: https://en.cppreference.com/w/cpp/language/character_literal,
https://en.cppreference.com/w/cpp/language/identifiers and https://learnmoderncpp.com/2021/03/24/a-unicode-primer/
<syntaxhighlight lang="c++">
#include <cstdint>
#include <iostream>
#include <string>
int main() {
uint32_t Δ = 1;
double π = 3.14159;
std::string 你好 = "Hello";
Δ++;
std::cout << Δ << " :: " << π << " :: " << 你好 << std::endl;
}
</syntaxhighlight>
{{ out }}
<pre>
2 :: 3.14159 :: Hello
</pre>
=={{header|Clojure}}==
Line 182 ⟶ 234:
That being said, it is not currently enforced, so while you probably shouldn't, you technically can.
<
(inc Δ))</
{{out}}
<pre>2</pre>
=={{header|Common Lisp}}==
<
(incf Δ))</
{{out}}
<pre>2</pre>
=={{header|Crystal}}==
<
Δ += 1
puts Δ</
{{out}}
<pre>2</pre>
Line 202 ⟶ 254:
=={{header|D}}==
D source files support four character encodings: ASCII, UTF-8, UTF-16 and UTF-32.
<
void main() {
Line 208 ⟶ 260:
Δ++;
writeln(Δ);
}</
{{out}}
<pre>2</pre>
Line 226 ⟶ 278:
=={{header|Delphi}}==
For more information about naming identifiers (including variables) visit: [http://docwiki.embarcadero.com/RADStudio/en/Identifiers Identifiers in Delphi]
<
program UnicodeVariableName;
Line 242 ⟶ 294:
Writeln(Δ);
Readln;
end.</
=={{header|DWScript}}==
<
Δ := 1;
Inc(Δ);
PrintLn(Δ);</
=={{header|Déjà Vu}}==
<
set :Δ ++ Δ
!. Δ</
=={{header|EchoLisp}}==
Symbol names can be any string including unicode characters. See the EchoLisp [http://www.echolalie.org/echolisp/help.html#language reference] documentation.
<
(define ∆-🍒 1) → ∆-🍒
(set! ∆-🍒 (1+ ∆-🍒)) → 2
(printf "🔦 Look at ∆-🍒 : %d" ∆-🍒)
🔦 Look at ∆-🍒 : 2
</syntaxhighlight>
=={{header|Elena}}==
ELENA
<
{
var Δ := 1;
Δ := Δ + 1;
console.writeLine
}</
=={{header|Emacs Lisp}}==
<
(setq Δ (1+ Δ))
(message "Δ is %d" Δ)</
Variables are symbols and symbol names can be any string. Source code <code>.el</code> files can have all usual Emacs coding system specifications to give variables in non-ASCII.
Line 286 ⟶ 338:
=={{header|F_Sharp|F#}}==
As with C# the [http://research.microsoft.com/en-us/um/cambridge/projects/fsharp/manual/spec.html#_Toc207705761 F# Language Specification] refers to [http://www.unicode.org/reports/tr31/#Default_Identifier_Syntax Unicode Standard Annex #31] for identifier syntax, allowing Unicode letter characters.
<
Δ <- Δ + 1
printfn "%d" Δ</
=={{header|Factor}}==
Variable names can contain any character, inlcuding unicode characters, as long as they don't parse as a string or a number.
<
[let
1 :> Δ!
Δ 1 + Δ!
Δ .
]</
=={{header|Forth}}==
Historically, Forth has worked only in ASCII (going so far as to reserve the eighth bit for symbol smudging), but modern implementations (e.g., Gforth) allow UTF-8 in word names, strings and comments.
<
1 ∆ !
1 ∆ +!
∆ @ .</
=={{header|FreeBASIC}}==
Line 315 ⟶ 367:
If one wanted to use a Greek character such as Δ for a variable name, it would therefore have to be spelled out :
<
Var delta = 1
delta += 1
Print delta '' 2
Sleep</
=={{header|Frink}}==
Frink can use Unicode variable names that meet certain constraints. Variable names that don't meet these constraints can still be parsed and displayed by specifying them as Unicode escapes: [https://frinklang.org/#UnicodeInFrink Unicode Variable Names]
<
Δ = 1
Δ = Δ + 1
println[Δ]
</syntaxhighlight>
=={{header|Go}}==
Go source encoding is [http://golang.org/doc/go_spec.html#Source_code_representation specified] to be UTF-8. Allowable variable names are specified in the sections [http://golang.org/doc/go_spec.html#Identifiers identifiers] and [http://golang.org/doc/go_spec.html#Exported_identifiers Exported identifiers].
<
import "fmt"
Line 340 ⟶ 392:
Δ++
fmt.Println(Δ)
}</
{{out}}
<pre>
Line 353 ⟶ 405:
Also, Haskell does not allow mutable variables, so incrementing delta isn't possible. Instead lower case psi was used to store the incremented value of delta since tridents are cool.
<
where δΔ = 1
ψ = δΔ + 1</
=={{Header|Insitux}}==
<syntaxhighlight lang="insitux">
(let Δ😄 1)
(inc Δ😄)
</syntaxhighlight>
{{out}}
<pre>
2
</pre>
=={{header|J}}==
Line 367 ⟶ 432:
=={{header|Java}}==
<
double π = 3.141592;
String 你好 = "hello";
Δ++;
System.out.println(Δ);</
{{out}}
<pre>
Line 378 ⟶ 443:
=={{header|JavaScript}}==
<
var ĦĔĽĻŎ = "hello";
var 〱〱〱〱 = "too less";
Line 384 ⟶ 449:
var KingGeorgeⅦ = "Roman numerals.";
console.log([ᾩ, ĦĔĽĻŎ, 〱〱〱〱, जावास्क्रिप्ट, KingGeorgeⅦ])</
{{out}}
<pre>
Line 394 ⟶ 459:
However, in practice, the keys of JSON objects can also be used as variable names. For example, in the following expression, "Δ" is in effect set to 1 and then its value is retrieved in the environment in which "Δ" has been set:
<
In jq 1.5 and later, <
Strictly speaking, variables in jq cannot be incremented (in fact, strictly speaking, jq does not have variables at all), but the equivalent operation is illustrated here:
<
| .["Δ"] += 1 # increment by 1
| .["Δ"] # emit the incremented value</
=={{header|Julia}}==
The Julia documentation on
[http://docs.julialang.org/en/latest/manual/variables/#allowed-variable-names allowed variable names] explicitly describes the wide variety of Unicode codepoints that are allowed:
<
2</
The allowed identifiers also include sub/superscripts and combining characters (e.g. accent marks):
<
4</
and the Julia interactive shells (and many editors) allow typing these symbols via tab-completion of their LaTeX abbreviations.
=={{header|Kotlin}}==
<
var Δ = 1
Δ++
print(Δ)
}</
{{out}}
Line 427 ⟶ 492:
=={{header|Lily}}==
<
Δ += 1
print(Δ.to_s())</
=={{header|Lingo}}==
Since version 11, in Lingo/Director both native strings and scripts use UTF-8 encoding. Variable names support Unicode characters:
<
Δ = Δ + 1
put Δ
-- 2</
=={{header|LiveCode}}==
In LiveCode 7+ all characters are stored as unicode. This includes variable (container) names, although it does not seem to state this in the LC dictionary.
<
add 1 to Δ
put Δ
-- result is 2</
=={{header|LOLCODE}}==
The [http://lolcode.com/specs/1.2#variables spec] mandates that identifiers be alphanumeric. However, the fact that [http://lolcode.com/specs/1.2#strings YARNs] are Unicode-aware permits the use of the [http://lolcode.com/proposals/1.3/bukkit2#srs-serious-cast SRS operator] introduced in 1.3 to utilize variables of arbitrary name.
<
SRS "Δ" R SUM OF SRS ":(394)" AN 1
VISIBLE SRS ":[GREEK CAPITAL LETTER DELTA]"</
{{out}}
<pre>2</pre>
Line 456 ⟶ 521:
Lua 5.3 supports UTF-8 encoding as documented here: https://www.lua.org/manual/5.3/manual.html#6.5 .
However, this support is not strictly necessary for this task so long as the Lua script is edited using a UTF-8 enabled text editor.
<
∆ = ∆ + 1
print(∆)</
{{out}}
<pre>2</pre>
Line 465 ⟶ 530:
=={{header|M2000 Interpreter}}==
case is not significant
The language has Greek statements too
<syntaxhighlight lang="m2000 interpreter">
Δ=1
Δ++
Line 472 ⟶ 538:
ᾩ=3
Print ᾩ**2=ᾩ^2, ᾩ^2-1=8
Τύπωσε ᾩ**2=ᾩ^2, ᾩ^2-1=8 ' this is Print statement too
Print ᾡ=3
जावास्क्रिप्ट=100
Line 480 ⟶ 547:
〱〱〱〱$="too less"
Print Left$(〱〱〱〱$, 3)="too"
c͓͈̃͂̋̈̆̽h̥̪͕ͣ͛̊aͨͣ̍͞ơ̱͔̖͖̑̽ș̻̥ͬ̃̈ͩ =100 : Print "c͓͈̃͂̋̈̆̽h̥̪͕ͣ͛̊aͨͣ̍͞ơ̱͔̖͖̑̽ș̻̥ͬ̃̈ͩ ="; c͓͈̃͂̋̈̆̽h̥̪͕ͣ͛̊aͨͣ̍͞ơ̱͔̖͖̑̽ș̻̥ͬ̃̈ͩ
</syntaxhighlight>
=={{header|Mathematica}}/{{header|Wolfram Language}}==
<syntaxhighlight lang="mathematica">Δ = 1;
Δ++;
Print[Δ]</
=={{header|Nemerle}}==
From the Nemerle [http://nemerle.org/wiki/index.php?title=Lexical_structure_%28ref%29 Reference Manual]: "Programs are written using the Unicode character set, using the UTF-8 encoding."
<
module UnicodeVar
Line 499 ⟶ 569:
WriteLine($"Δ = $Δ");
}
}</
=={{header|NetRexx}}==
The ''NetRexx Language Definition'' section of the NetRexx documentation ([http://netrexx.org/files/nrl3.pdf netrexx.org/files/nrl3.pdf]) describes the character set support within the language.
<
options replace format comments java crossref symbols nobinary
Line 536 ⟶ 606:
return
</syntaxhighlight>
'''Output:'''
<pre>
Line 551 ⟶ 621:
From the spec: https://nim-lang.org/docs/manual.html#lexical-analysis-identifiers-amp-keywords
<
inc Δ
echo Δ</
=={{header|Objeck}}==
As of 3.2, Objeck supports UTF-8 encoded I/O and stores characters in the runtime's native Unicode format.
<
class Test {
function : Main(args : String[]) ~ Nil {
Line 567 ⟶ 637:
}
}
</syntaxhighlight>
=={{header|Ol}}==
Ol fully supports Unicode.
<
(define Δ 1)
(define Δ (+ Δ 1))
(print Δ)
</syntaxhighlight>
{{out}}
Line 593 ⟶ 663:
2.
<
<@ ACTICRVAR>Δ</@>
<@ SAYVAR>Δ</@></
Using what Google Translate says is the Traditional Chinese for 'delta'
<
<@ ACTICRVAR>三角洲</@>
<@ SAYVAR>三角洲</@></
=={{header|Perl}}==
Requires Perl 5.8.1 at the minimum. See http://perldoc.perl.org/utf8.html
<
my $Δ = 1;
$Δ++;
print $Δ, "\n";</
<code>$</code> sigil can be omitted by using [http://perldoc.perl.org/perlsub.html#Lvalue-subroutines lvalue] subroutine:
<
BEGIN {
Line 623 ⟶ 693:
Δ = 1;
Δ++;
print Δ, "\n";</
or with Perl 5.10 and [http://perldoc.perl.org/functions/state.html state] modifier:
<
use v5.10;
Line 636 ⟶ 706:
Δ = 1;
Δ++;
say Δ;</
One can have Unicode in identifier or subroutine names and also in package or class names. Use of Unicode for the last two purposes is, due to file and directory names, dependent on the filesystem.
Line 642 ⟶ 712:
=={{header|Phix}}==
Phix does not officially support unicode variable names, however it took me less than 5 minutes (changes, which are now permanent, labelled with "for rosettacode/unicode" in ptok.e and pttree.e, setting charset and identset respectively) to get the following to work, as long as the source file is stored using utf8 with a proper BOM, as supported by Notepad and the included Edita. I will happily add further character ranges as required/requested: I simply don't know what those ranges are, but I believe that no code points in utf8 should overlap existing ascii chars such as +-* etc.
<!--<syntaxhighlight lang="phix">(phixonline)-->
<span style="color: #008080;">with</span> <span style="color: #008080;">javascript_semantics</span>
<span style="color: #004080;">integer</span> <span style="color: #000000;">Δ</span> <span style="color: #0000FF;">=</span> <span style="color: #000000;">1</span>
<span style="color: #000000;">Δ</span> <span style="color: #0000FF;">+=</span> <span style="color: #000000;">1</span>
<span style="color: #0000FF;">?</span><span style="color: #000000;">Δ</span>
<!--</syntaxhighlight>-->
{{out}}
<pre>
Line 656 ⟶ 729:
Documentation: [http://php.net/manual/en/mbstring.php4.req.php mbstring.php4.req], [http://php.net/manual/en/language.variables.basics.php language.variables.basics]
<
$Δ = 1;
++$Δ;
echo $Δ;</
=={{header|PicoLisp}}==
Variables are usually [http://software-lab.de/doc/ref.html#internal-io Internal Symbols], and their names may contain any UTF-8 character except null-bytes. White space, and 11 special characters (see the reference) must be escaped with a backslash. [http://software-lab.de/doc/ref.html#transient-io Transient Symbols] are often used as variables too, they follow the syntax of strings in other languages.
<
-> 1
: Δ
Line 670 ⟶ 743:
-> 2
: Δ
-> 2</
=={{header|Pike}}==
<syntaxhighlight lang="pike">
#charset utf8
void main()
Line 681 ⟶ 754:
write( Δ +"\n");
}
</syntaxhighlight>
{{Out}}
<pre>
Line 688 ⟶ 761:
=={{header|PowerShell}}==
<syntaxhighlight lang="powershell">
$Δ = 2
$π = 3.14
$π*$Δ
</syntaxhighlight>
<b>Output:</b>
<pre>
Line 699 ⟶ 772:
=={{header|Prolog}}==
<
是. % be: means, approximately, "True".
不是 :- \+ 是. % not be: means, approximately, "False". Defined as not 是.
Line 709 ⟶ 782:
% Call test2(1, Result) to have 2 assigned to Result.
test2(Δ, R) :- R is Δ + 1.</
Putting this into use:
<
true.
Line 723 ⟶ 796:
?- test2(1,Result).
Result = 2.</
=={{header|Python}}==
Line 731 ⟶ 804:
Identifiers are unlimited in length. Case is significant.
<
>>> Δx += 1
>>> print(Δx)
2
>>> </
=={{header|R}}==
See <code>?assign</code> for details.
<
f(1)</
{{out}}
<pre>[1] 2</pre>
Line 750 ⟶ 823:
Racket has virtually no restrictions on valid characters for identifiers. In particular, Unicode identifiers are supported.
<syntaxhighlight lang="racket">
#lang racket
Line 764 ⟶ 837:
(printf "Δ = ~s\n" Δ) ; prints "Δ = 2"
</syntaxhighlight>
=={{header|Raku}}==
Line 770 ⟶ 843:
Raku is written in Unicode so, with narrow restrictions, nearly any Unicode letter can be used in identifiers.
See the current Raku
<syntaxhighlight lang="raku"
$Δ++;
say $Δ;</
Function and subroutine names can also use Unicode characters: (as can methods, classes, packages, whatever...)
<syntaxhighlight lang="raku"
sub π { pi };
Line 783 ⟶ 856:
for @ᐁ -> $ಠ_ಠ { say sin $ಠ_ಠ° };
sub c͓͈̃͂̋̈̆̽h̥̪͕ͣ͛̊aͨͣ̍͞ơ̱͔̖͖̑̽ș̻̥ͬ̃̈ͩ { 'HE COMES' }</
<br>
Line 790 ⟶ 863:
=={{header|Retro}}==
<
#1 !Δ
@Δ n:put
&Δ v:inc
@Δ n:put</
Function and variable names are stored as strings, and UTF-8 is usable, as long as the host system allows it.
Line 805 ⟶ 878:
Note: this REXX program ''only'' works with the '''R4''' or '''ROO''' REXX interpreter under DOS or DOS under Windows.
This REXX program works because the '''R4''' and '''ROO''' REXX interpreters
<
'chcp' 1253 "> NUL" /*ensure we're using correct code page.*/
Δ=1 /*define delta (variable name Δ) to 1*/
Δ=Δ+1 /*bump the delta REXX variable by unity*/
say 'Δ=' Δ /*stick a fork in it, we're all done. */</
'''output'''
<pre>
Line 817 ⟶ 890:
=={{header|Ring}}==
<
# Project : Unicode variable names
Δ = "Ring Programming Language"
see Δ + nl
</syntaxhighlight>
Output:
<pre>
Line 830 ⟶ 903:
=={{header|Ruby}}==
Ruby supports about 100 encodings, the default being UTF-8.
<
Δ += 1
puts Δ # => 2</
=={{header|Rust}}==
Line 839 ⟶ 912:
<b>Non-ASCII identifiers are [https://github.com/mozilla/rust/pull/10605 feature gated] since version 0.9</b>
<
#![allow(non_snake_case)]
Line 846 ⟶ 919:
Δ += 1;
println!("{}", Δ);
}</
=={{header|S-lang}}==
Line 868 ⟶ 941:
not just in variable but also function and reference names, and tested under
S-Lang versions 2.0.6 and pre2.3.1-23.
<
@∆ref++;
}
Line 879 ⟶ 952:
print(foo∆bar);
print(∆bar);
</syntaxhighlight>
{{out}}
2
Line 885 ⟶ 958:
=={{header|Scala}}==
<
val π = 3.141592
val 你好 = "hello"
Δ += 1
println(Δ)</
=={{header|SenseTalk}}==
<
add 1 to Δ
put Δ</
{{out}}
<pre>2</pre>
=={{header|Sidef}}==
<
Δ += 1;
say Δ;</
{{out}}
<pre>2</pre>
Line 909 ⟶ 982:
Here is how to create a macro, a scalar and a Mata variable named Δ:
<
sca Δ=Δ+1
di Δ
Line 921 ⟶ 994:
Δ++
Δ
end</
=={{header|Swift}}==
<
let π = 3.141592
let 你好 = "hello"
Δ++
println(Δ)</
{{out}}
<pre>
Line 935 ⟶ 1,008:
=={{header|Tcl}}==
Tcl variable names can include any character <!-- but the <tt>::</tt> sequence is special — it is the namespace separator — and there are restrictions when parentheses are involved, as they are used for associative arrays; these are not matters that are in the spirit of this task though, so this is a comment! --> (the <code>$var</code> syntax can't, but that's just a shorthand for the operationally-equivalent <code>[set var]</code>). Also (in tcl 8.6, at least), the <code>${var}</code> syntax does work. Thus, this script is entirely legal:
<
incr Δx
puts [set Δx]
puts ${Δx}</syntaxhighlight>
However, this script only works smoothly if the “<tt>Δ</tt>” character is in the system's default encoding (thankfully more common than it used to be, as more and more systems use UTF-8 or UTF-16 as their default encodings) so normal Tcl practice is to stick to ASCII for identifier names.
It is also possible to encode characters using a <tt>\u''XXXX''</tt> substitution (each <tt>''X''</tt> is a hexadecimal digit), thus the <code>Δx</code> could be replaced throughout above by <code>\u0394x</code>; the result is a variable with exactly the same name as before. Doing this allows a script to be written with just ASCII characters, which tends to maximize portability across platforms.
=={{header|UNIX Shell}}==
{{works with|zsh}}
<syntaxhighlight lang="bash">
Δ=1
Δ=`expr $Δ + 1`
echo $Δ
</syntaxhighlight>
{{out}}
<pre>2</pre>
=={{header|Vala}}==
Vala has limited support for Unicode in variable names. This limitation comes from its source-to-source compilation to C.
=={{header|VBA}}==
:''See [[Unicode variable names#Visual Basic|Visual Basic]]''
=={{header|Visual Basic}}==
{{works with|Visual Basic|4}}
{{works with|Visual Basic|5}}
{{works with|Visual Basic|6}}
<syntaxhighlight lang="vb">Sub Main()
Dim Δ As Integer
Δ=1
Δ=Δ+1
Debug.Print Δ
End Sub</syntaxhighlight>
{{out}}
<pre>2</pre>
=={{header|Wren}}==
Line 952 ⟶ 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.
<
var b = 2
var delta = a - b // ok
var Δ = delta // not ok</
{{out}}
Line 961 ⟶ 1,060:
[./unicode_ident line 4] Error: Invalid byte 0xce.
[./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="wren">import "./trait" for Var
Var["Δ"] = 1
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}}
<pre>
2
</pre>
=={{header|zkl}}==
The short answer is zkl identifiers are a small subset of ASCII. This is enforced by the compiler. That said, the VM doesn't particularly care about names (although UTF-8 will cause sorting/etc issues). So ...
<
klass:= // embryo(names, numFcns, numClasses, numParents, ...)
self.embryo(L("","",delta),0,0,0).cook();
Line 973 ⟶ 1,108:
dv:=klass.setVar(0); // which actually gets the var, go figure
dv.inc(); // ie (*ptr)++
dv.value.println();</
{{out}}
<pre>
Line 979 ⟶ 1,114:
2
</pre>
{{omit from|6502 Assembly|Depends on the assembler, and variable names don't exist at runtime anyway.}}
{{omit from|68000 Assembly}}
{{omit from|8080 Assembly}}
{{omit from|8086 Assembly}}
{{omit from|AWK}}
{{omit from|BASIC}}
Line 985 ⟶ 1,123:
{{omit from|Bc}}
{{omit from|BLAST}}
{{omit from|C++}}
{{omit from|Dc}}
{{omit from|EasyLang}}
{{omit from|Erlang|Not yet but planned}}
{{omit from|Free Pascal}}
Line 996 ⟶ 1,136:
{{omit from|TUSCRIPT}}
{{omit from|Unicon}}
{{omit from|Z80 Assembly|Depends on the assembler, and variable names don't exist at runtime anyway.}}
{{omit from|ZX Spectrum Basic}}
|