▲ | senkora 3 days ago | |||||||||||||||||||||||||
> An operator can be overloaded in C plus plus, but right now operators in the Java pro- gramming language can not be overloaded by the programmer, though names of methods may be overloaded. I would like to change that It’s a shame that he lost this battle. Operator overloading really does make it a lot nicer to design certain kinds of libraries. | ||||||||||||||||||||||||||
▲ | chubot 3 days ago | parent | next [-] | |||||||||||||||||||||||||
FWIW another thing that Guy Steele advocated was value types, which as I understand it is ongoing work: https://en.wikipedia.org/wiki/Project_Valhalla_(Java_languag... https://openjdk.org/projects/valhalla/ I have said in the past, and will say now, that I think it would be a good thing for the Java programming language to add generic types and to let the user define overloaded operators. He did get the generic types though, I think that was well over a decade ago now | ||||||||||||||||||||||||||
| ||||||||||||||||||||||||||
▲ | owlstuffing 3 days ago | parent | prev | next [-] | |||||||||||||||||||||||||
Agree 1000% There’s a Java compiler plugin[1] that muscles in operator overloading pretty comprehensively, and works with all LTS JDKs. 1. https://github.com/manifold-systems/manifold/tree/master/man... | ||||||||||||||||||||||||||
▲ | swyx 3 days ago | parent | prev [-] | |||||||||||||||||||||||||
i mean okay but also it makes it impossible to have an open source ecosystem with shared libraries because suddenly things dont mean the same thing in one system vs another. i was interviewing at Jane St and realized their OCaml completely doesnt work with the rest of the world - and its fine if you're Jane St i guess but that really sucks for the "health" of a language ecosystem. | ||||||||||||||||||||||||||
|