What characters valid Kotlin identifiers? Some uni...
# mathematics
b
What characters valid Kotlin identifiers? Some unicode characters are allowed without backtick-escaping. For example
val ε = 0.03
is a valid statement, but
val ∇ = 0.03
is not.
Apparently it allows symbols from Unicode character categories
Lu
,
Ll
,
Lt
,
Lm
,
Lo
,
Nl
and
Nd
. The lexical grammar is defined here: https://github.com/JetBrains/kotlin-spec/blob/master/kotlin-spec.asc#42-lexical-grammar
g
You also can use backtickes:
Copy code
val `∇` = 0.03
b
Yeah, but are also some restrictions on characters you can put inside backticks