Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I think this would work in many languages with operator overloading. Same thing in C#: https://gist.github.com/lostmsu/6922f6e1f5b4f07c88358e92d6e8...

Not sure yet if it is possible to make this work for generic operators.



C# 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 +"


By 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: