[ 
https://issues.apache.org/jira/browse/GROOVY-2756?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Paul King updated GROOVY-2756:
------------------------------
    Fix Version/s:     (was: 3.x)
                   4.x

> create new user overwritable operator methods for <,==,>,<=,=>,<==>
> -------------------------------------------------------------------
>
>                 Key: GROOVY-2756
>                 URL: https://issues.apache.org/jira/browse/GROOVY-2756
>             Project: Groovy
>          Issue Type: Improvement
>          Components: groovy-runtime
>            Reporter: Jochen Theodorou
>            Priority: Major
>             Fix For: 4.x
>
>
> as not everything we want to let <,==,>,<=,=>,<==> operate on is a total 
> order, it would be nice to have one of these defined only. Also the current 
> solution with Comparable seems to lead to many problems, because Comparable 
> itself is thought to be used with an exact counter part, but we might want to 
> let it work on other classes as well. for this we should go away from 
> Comparable. I would suggest we write a single method with a bitfield 
> containing flags for <,> and ==. Then the user can throw an exception if a 
> flagged operation is not available, also he can implement only < (100) or > 
> (010) or == (001) or <= (101) or =>(011) or <=> (111).  the way to keep 
> backwards compatibility with this would be to add a compareTo method that 
> uses the bits 111.. Well needs more discussion



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to