https://kotlinlang.org logo
#getting-started
Title
# getting-started
n

nkiesel

12/13/2021, 11:09 PM
Groovy allows
$
in identifiers (e.g.
A$B
is a valid identifier). Kotlin allows quoted identifiers like ``A$B`` . But https://kotlinlang.org/spec/syntax-and-grammar.html#identifiers states that letters are "<any unicode character of classes LL, LM, LO, LT, LU or NL>" and that identifiers are "(Letter |
'_'
) {Letter |
'_'
| UnicodeDigit} | `'`'` QuotedSymbol {QuotedSymbol} `'`'` ". Does that not mean that e.g. Ⅲ (aka \u2162) - which is part of unicode character class NL - should be a valid identifier? I just tried but the compiler does not like
val Ⅲ = "roman 3"
.
e

ephemient

12/13/2021, 11:52 PM
that's interesting, kotlin doesn't seem to allow it as a identifier part at all.
val _Ⅲ
doesn't work either
n

nkiesel

12/14/2021, 9:20 PM
yes. Seems the language spec is wrong (or the implementation). Do you know the best place to bring that to attention?
e

ephemient

12/14/2021, 9:23 PM
https://github.com/Kotlin/kotlin-spec if it were the spec, but to me it feels like it's the implementation that should be brought into compliance, in which case, https://youtrack.jetbrains.com/issues/KT I think?
4 Views