3 ms·
In my humble opinion, a lot of the dislike of operator overloading is related to unexpected runtime performance. My ideal solution would be for the language to
by zoogeny 2y ago
In my humble opinion, a lot of the dislike of operator overloading is related to unexpected runtime performance.
My ideal solution would be for the language to introduce custom operators that clearly indicate an overload. Something like a prefix/postfix (e.g. `let c = a |+| b`). That way it is clear to the person viewing the code that the |+| operation is actually a function call.
This is still open to abuse but I think it at least removes one of the major concerns.