[Proposal] Support Unicode Mathematical Symbols Block as user-defined operators

32 views
Skip to first unread message

Kip

unread,
Sep 16, 2022, 10:43:56 PM9/16/22
to elixir-lang-core
Today Elixir allows a very flexible set of Unicode characters to form part of an identifier (there is a Unicode standard for this).  There is a limited set of reserved operators permitted as well.

This proposal seeks to assess if there is any support to some or all of the Unicode Mathematical Symbols block to the list of allowed user defined operators.

* The increased focus on numerical computation in Elixir could benefit from an expressive set of operators

* Certain operators like the "set" (element, union, intersection, ....) operators reflect the list/set operations in common use in Elixir across enumerables, lists, map sets and maps.

* Certain mathematical expressions are more readily expressed with infix notation (especially when the implementation represents a formula from published works). I am finding this to be true in my own work in Image (image processing) and Tempo (time expressions).  I suspect this would be true for numerical computations in Nx but have not validated this.

* These operators do no clash with any existing operators so would not introduce backward compatibility issues and would require minimal changes to the Elixir lexer (an assumption by me)

José Valim

unread,
Sep 17, 2022, 11:50:49 AM9/17/22
to elixir-lang-core
I believe it is unlikely we will add Unicode _operators_.

We may support mathematical characters as Unicode identifiers, depending on the use-case. :)

--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/2d5e34dd-314b-4a5e-b490-f1b8d2c4f096n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages