You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You are a genius! Thanks for your wonderful job!
What about defining custom operators? maybe not as flexible as Scala, when you can have the pope operator <+|:-) if you want. But I was thinking about the eq operator, so
a eq b means Object.equals(a, b). It allows you to skip null checks, keep the == for references, and it is nicer on the eye.
Also, one small thing, the example code is somehow wrong, map.get("qwe")==null is not the same as map.containsKey("qwe") unless map is null free.
(I was also going to ask about null handling with ?, but pretty much everything I want to ask is already written in 'ideas' file)
Again, incredible work!
The text was updated successfully, but these errors were encountered:
from #22: Adding new operators is very complicated. To do it we need to extend Java parser but oo-plugin only works after parsing (in annotation processing stage). There are no extension points before annotation processing in Java7 compiler.
But there is some support of plugins in Java8 compiler (-Xplugin). Maybe it is possible to extend parser there. More research needed.
About map["qwe"]. Yes. It is not the same. I just tried to fit more use cases in small example. The difference doesn't really matter for the example.
Thanks
You are a genius! Thanks for your wonderful job!
What about defining custom operators? maybe not as flexible as Scala, when you can have the pope operator <+|:-) if you want. But I was thinking about the eq operator, so
a eq b means Object.equals(a, b). It allows you to skip null checks, keep the == for references, and it is nicer on the eye.
Also, one small thing, the example code is somehow wrong, map.get("qwe")==null is not the same as map.containsKey("qwe") unless map is null free.
(I was also going to ask about null handling with ?, but pretty much everything I want to ask is already written in 'ideas' file)
Again, incredible work!
The text was updated successfully, but these errors were encountered: