KEEP for overloadable bitwise operators


#1

I was reminded of this today, and I would like to see more community feedback such that I could improve it.
Late July I opened KEEP 142 as a proposal to introduce overloadable bitwise operators to Kotlin. This proposal would keep the infix operators as they are (for the time being), while also introducing new operators in keeping with the syntax of the operators in other languages. If merged, this would provide a fix to KT-1440 while also making plenty of Kotlin spread amongst many projects easier to read


#2

I replied to the KEEP. No point in starting a 3rd discussion about this when there are 2 out there already :wink:


#3

Of course, I just wanted to get more attention to that KEEP, since it’s pretty much been dormant since late July/early August.


#4

Sure and I don’t think it’s a bad idea to mention it here. There might be a few people here that don’t watch the KEEP. But you also have to consider that there is no guarantee that a KEEP will be implemented in the language and as far as I have seen most people on the Kotlin team are against bitwise operators (at least all comments about them are negative).


#5

I’m well aware that the Kotlin team seems to have a distaste for bitwise operators, though I’m unsure as to why. I actually have this proposal fully implemented in what started with “hacking on kotlinc to learn”. This proposal was opened because I would be extremely happy to provide those contributions to upstream to allow such functionality.


#6

In that case you should probably upload your prototype to github and add the link to it in the KEEP. A working prototype might help a lot.


#7

The KEEP does note that a prototype is implemented, though i will add a link for it. In the mean time my fork with the additions is at https://github.com/Redrield/Kotlin/tree/bitwise-operators