jank-lang / jank

The native Clojure dialect hosted on LLVM
https://jank-lang.org
Mozilla Public License 2.0
1.69k stars 50 forks source link

Support Unicode identifiers (symbols/keywords) #89

Open jeaye opened 2 months ago

jeaye commented 2 months ago

Clojure defines symbols (keywords inherit the same behavior) to include the following:

Symbols begin with a non-numeric character and can contain alphanumeric characters and *, +, !, -, _, ', ?, <, > and = (other characters may be allowed eventually).

Clojure treats "non-numeric character" and "alphanumeric characters" to include pretty much any Unicode character. This includes the various Unicode whitespace characters.

; Supported for symbols.
user=> (def 😁 :smile)
#'user/😁

; Supported for keywords.
user=> (def fqkw :🙃/😁)
#'user/fqkw
user=> fqkw
:🙃/😁

; Even Unicode whitespace characters are supported.
user=> (def   2)
#'user/
user=>
2