merscwog commented on PR #1915:
URL: https://github.com/apache/groovy/pull/1915#issuecomment-1645571858

   I'm sure this will not satisfy everyone, but what if I did:
   - intersect() already exists, so tie that to '&' for all the same types 
(alias essentially, although just for non-comparator, since the long-form alias 
would always be available)
   - create a union() operator for all types, and tie it to '|' for those same 
types (very similar behavior to existing intersect() operator -- so it attempts 
to preserve original collection orders, but does not insert duplicates based 
upon the comparator into resulting collection)
   - create a symmetricDiff() operator for all types and tie it to '^' (using 
minus and union operators, although I believe with the two minuses all 
comparator-specific behavior for the union might be unnecessary and a simple 
plus could suffice -- I haven't 100% convinced myself this is true always, but 
I'm hoping that it is)
     -  union(minus(a,b,comparator), minus(b,a,comparator), comparator) => 
plus(minus(a,b,comparator), minus(b,a,comparator))
   
   aliased '&', '|', '^' would only be for the non-comparator variants of the 
operators.  Or, I only have those convenience operators for Sets.


-- 
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-unsubscr...@groovy.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to