I advise you to take a smaller bite. This issue is difficult to deal
with and not fully discussed at all. The change will have impact on
semantics as well as performance and is difficult to deal with in
general. Which is why it has a target for Groovy 3.
Am 16.07.2015 04:36, schrieb Martin Lukas:
Hi all,
I would like to contribute to Groovy by starting to provide an improvement
for [GROOVY-2756] (this one would be very useful for a library I started to
work on): https://issues.apache.org/jira/browse/GROOVY-2756
My approach would be the following:
I would start by extending the
org.codehaus.groovy.classgen.asm.BinaryExpressionHelper such that the
following methods would be invoked "compareEqual", "compareLessThan",
"compareLessThanEqual", "compareGreaterThan", "compareGreaterThanEqual" in
case of ==,<,<=,>,>=.
I would then like to add defaults of these methods to all Objects (or
Numbers/or Comparables?) that forward the request to the
org.codehaus.groovy.runtime.ScriptBytecodeAdapter static methods. This would
ensure that in case there are no user-defined methods for comparison, the
default methods or compareTo() are used. Where would be the best place to
add this extension to the Object (or Numbers/or Comparables?) class?
I would like to ask the Groovy experts if you think whether this approach is
feasible or would you recommend a different approach?
Thanks,
Martin
--
View this message in context:
http://groovy.329449.n5.nabble.com/GROOVY-2756-Would-like-to-become-a-contributor-tp5726223.html
Sent from the Groovy Dev mailing list archive at Nabble.com.
--
Jochen "blackdrag" Theodorou
blog: http://blackdragsview.blogspot.com/