amelentev / java-oo

Java Operator Overloading
http://amelentev.github.io/java-oo/
268 stars 31 forks source link

Suggestion: "not" as "complement, boolean "not" overload, and possible type casting? #27

Open ghost opened 9 years ago

ghost commented 9 years ago

Not an "issue" per say, unless you count personal preference towards issues, but I figured this was the easiest place to put this.

I started messing around with this plugin in IDEA (you actually got me to use IDEA since my Eclipse version isn't yet supported) and I absolutely love it, I can finally have cleaner math-related Java code. Especially when working with game math and personal languages/features, the ability to clean up code in this way is amazing coming out of Java.

I have noticed both things I'm not fond of and things I'd like to see added. I would really like to see an overload option for the boolean not operator, since it seems one of the only ones not currently implemented (I don't know if there are more,) but in order to do that I have to also suggest changing the method overload name for the bitwise complement/not to "complement." Neither of those sounds like an issue unless you'd like to guarantee compatibility with previous versions, in which case the "not" name change may actually be a problem.

The other thing I've been wanting is a type cast overload, which I'm pretty sure could be implemented identical to a standard assignment overload by searching for the same valueOf(x) method. With a type cast overload new local variables wouldn't need to always be created when using the assignment overload, but could just be used in expressions.