paulk-asert commented on PR #2210:
URL: https://github.com/apache/groovy/pull/2210#issuecomment-2848880644

   This is an interesting proposal.
   
   One immediate point of feedback is I would change the IntRange semantics to 
follow normal Groovy idioms. I know that means it might be slightly different 
to rust and other languages, but it follows what we do for all other Groovy 
methods. So, basically you'd get rid of the "- 1" when accessing getToInt() and 
change your examples from "0..arr.size()" to "0..<arr.size()" or "0..-1". 
Groovy let's you pick between (l, r), [l, r), [l, r] etc by using 0<..<4, 
1..<4, 1..3 etc. I also haven't checked yet whether reverse ranges are handled 
properly, but perhaps you've already considered that.
   
   Also, Java doesn't have a sorted list but offers Collections.sort(). Groovy 
doesn't have partition (currently) but does have groupBy. So, I think it makes 
sense to discuss in more detail how this would typically be used. Is it less 
useful than in other languages given the JDK collection semantics or is other 
functionality needed (like a partition extension method) to reap the full 
benefits. I think discussing such things is best on the mailing list or the 
issue.


-- 
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