Zulip Chat Archive

Stream: lean4

Topic: Unicode in string literals


Eric Wieser (Sep 24 2024 at 00:58):

What's the syntax for creating a Char from a non-bmp unicode offset?

#eval '\u0061' -- ok
#eval '\u1F300' -- syntax error
#eval '\U0001F300' -- syntax error

Kyle Miller (Sep 24 2024 at 01:11):

There's no syntax for that at the moment beyond "🌀"

Damiano Testa (Sep 24 2024 at 01:13):

You can also use #eval Char.ofNat 0x1f300 :smile:

Eric Wieser (Sep 24 2024 at 01:15):

I threw together a draft at lean4#5443, but I guess that needs an RFC and tests


Last updated: May 02 2025 at 03:31 UTC