Fwd: Operator as first class citizens -- like in scala -- or yet another new operator?

On Wed, May 22, 2019 at 2:54 PM Rhodri James <rhodri@kynesim.co.uk> wrote:
Fully acknowledge it. I am from hardware design background so I do assume I might know what it means by elegant in hardware design. I do agree too that overloading the equal sign is probably asking for more problem than the problem it solves. That is the reason why I would like to see if this arrow method I proposed makes sense, or actually Python developers would love to make it possible for users to define their own operators (consider in math, how many operators would mathematicians love to see, and make it possible to write beautiful math formula directly in Python, like the matrix operations in PEP465. Just another example from the TLA+ formal language, if Python would allow defining new operators, you don't even need to write a parser for TLA+, you can write TLA+ using the mathematical operators you like directly in Python instead. https://github.com/tlaplus/Examples/blob/master/specifications/MissionariesA... IsSafe(S) == \/ S \subseteq Cannibals \/ Cardinality(S \cap Cannibals) =< Cardinality(S \cap Missionaries)
participants (1)
-
Yanghao Hua