You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "paulk-asert (via GitHub)" <gi...@apache.org> on 2023/07/16 23:58:00 UTC
[GitHub] [groovy] paulk-asert commented on pull request #1915: GROOVY-11127: Set operator extension methods
paulk-asert commented on PR #1915:
URL: https://github.com/apache/groovy/pull/1915#issuecomment-1637221541
@eric-milles Just some notes about historical feature requests/discussions (which we can re-evaluate if we think they no longer hold but shouldn't totally ignore):
- Folks asked us to retain the sorted nature of sets for as many operators as possible which is why there are 48 existing DGM methods which follow that pattern.
- Folks using Groovy operators on heterogeneous data very much like `NumberAwareComparator` but in some data science scenarios with homogeneous data, folks didn't want the performance hit. That's why I asked for those methods to be added. But I note that while we previously added that capability for `intersect` and `minus` we don't currently have it for `plus` (though we probably should).
- There have also been numerous discussions on commutativity in the past. We don't expect commutativity for normal method calls, e.g. `List#add(String)` isn't the same as `String#add(List)` but for operators there is a higher expectation that commutativity will hold. But even for mathematical operators, minus isn't commutative for instance. So, we while it has been a desirable feature for operators, we haven't had a strict requirement to always support commutativity. Do a search on "commutativity" on markmail (or elsewhere) and you will see numerous discussions.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@groovy.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org