Thread
#mathematics
    breandan

    breandan

    3 years ago
    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
    gildor

    gildor

    3 years ago
    You also can use backtickes:
    val `∇` = 0.03
    breandan

    breandan

    3 years ago
    Yeah, but are also some restrictions on characters you can put inside backticks