Zulip Chat Archive
Stream: general
Topic: Emoji as variable names
Martin Dvořák (Jun 11 2025 at 09:24):
Is it possible to use emoji as variable names without the french quotation marks?
example («🐶» «🐱» : Nat) : «🐶» + «🐱» = «🐱» + «🐶» :=
Nat.add_comm «🐶» «🐱»
I would like to be able to write:
example (🐶 🐱 : Nat) : 🐶 + 🐱 = 🐱 + 🐶 :=
Nat.add_comm 🐶 🐱
Is there any project-wide settings that I could use, even if it means enumerating all allowed symbols ahead of time?
Johan Commelin (Jun 11 2025 at 09:37):
I think you can't easily change what identifiers can look like. But you could hack together an elaborator/delaborator pair that converts between 🐶 and emoji_🐶.
Martin Dvořák (Jun 11 2025 at 10:25):
Yeah but emoji_🐶 needs to be frenchquoted, too.
Johan Commelin (Jun 11 2025 at 11:55):
Sure, the elaborator can do that for you.
Edward van de Meent (Jun 11 2025 at 12:02):
doesn't this need to happen at tokenization instead of at elaboration?
Last updated: Dec 20 2025 at 21:32 UTC