2 ms·
I think this would work in many languages with operator overloading. Same thing in C#: https://gist.github.com/lostmsu/6922f6e1f5b4f07c88358e92d6e8b312 https://
by lostmsu 5y ago
I think this would work in many languages with operator overloading. Same thing in C#: https://gist.github.com/lostmsu/6922f6e1f5b4f07c88358e92d6e8b312 https://gist.github.com/lostmsu/6922f6e1f5b4f07c88358e92d6e8...
Not sure yet if it is possible to make this work for generic operators.
- eyegor 5y agoC# does not allow generic custom operators, F# does, C doesn't, C++ does, several lisps do, but it's certainly not a common language feature. In C# you can overload most of the normal operators, but you can't, for example, define your own "~==" or overload "+=" to be anything other than "= self +"
- lostmsu 5y agoBy generic operators I did not mean custom operator tokens, but operators, that take type parameters. Or I did not understand the relevance of your comment to my pondering.