Details
-
New Feature
-
Status: Closed
-
Major
-
Resolution: Won't Fix
-
1.5.7
-
None
-
None
-
Eclipse 3.4
Windows XP SP3
Description
Currently, groovy maps operators to predefined method names. For example, plus or minus. Those names are the ones in java standard classes such as BigDecimal, but some libraries use different names. Apfloat, for example, uses "add" instead of "plus"
I'd like to be able to override this behaviour, and define operator in a way similar to c++. That is, leave the current name mapping as default, and allow to override.
I think, the best option is to use an operator annotation @Operator("+"). This has the advantage that can be used in java classes, and will simply be ignored in pure java projects.
Attachments
Issue Links
- is related to
-
GROOVY-1077 operator overloading
- Closed