3 ms·
It means that "overloading" an operator in Scala is not a special case - downthread someone was saying this addition to python was great not because they were g
by lmm 13y ago
It means that "overloading" an operator in Scala is not a special case - downthread someone was saying this addition to python was great not because they were going to use @ to multiply matrices but because now they could overload @ to do things with their own types. In Scala you wouldn't have to wait for a new operator to be added to the language - "defining a custom operator" is exactly the same as "overloading an existing operator". If you want to make "a + b" work, you define a "+" method on a. If you want to make "a @ b" work, you define an "@" method on a. If you want to make "a ə b" do something, you define a "ə" method.
You're right that scala does special-case the precedence of a small number of operators (the list is much shorter than the likes of C, but I still wish we could move away from it).