[ 
https://issues.apache.org/jira/browse/GROOVY-7432?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14561826#comment-14561826
 ] 

Paul King edited comment on GROOVY-7432 at 5/28/15 4:40 AM:
------------------------------------------------------------

Yes, design of general purpose libraries can be a little hard! :-)

I think you could justify either pattern - you'll have to make a call on what 
brings most consistency. What do other languages/libraries do?

if this case ends up being the only one where you don't re-join into Strings or 
if you start getting lists of chars instead of String for the char-args case, 
then perhaps join to Strings is the best but otherwise your suggestion sounds 
fine to me.

The main thing is to document clearly. And remember that the 
string.toList().groupBy() option isn't far away if they want some other 
behavior.

Also, once your done there will be a little bit of time between when you create 
the PR and when we commit - so there is a chance for others to check for 
consistency.


was (Author: paulk):
Yes, design of general purpose libraries can be a little hard - I think you 
could justify either pattern - if this case ends up being the only one where 
you don't re-join into Strings or if you start getting lists of chars instead 
of String for the char-args case, then I'd join to Strings but otherwise your 
suggestion sounds fine to me. We just have to document clearly. And remember 
that the string.toList().groupBy() option isn't far away if they want the other 
behavior.

> Enhance CharSequence with appropriate Iterable extension methods
> ----------------------------------------------------------------
>
>                 Key: GROOVY-7432
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7432
>             Project: Groovy
>          Issue Type: Improvement
>          Components: groovy-jdk
>            Reporter: Peter Ledbrook
>            Assignee: Guillaume Laforge
>
> Groovy enables developers to treat {{CharSequence}}s as if they were true 
> sequences. For example, you can use a for loop and the array index operator. 
> Some extension methods are missing though. One I was hoping to find was the 
> {{count(Closure)}} method. I think it makes sense to incorporate any 
> {{Iterable}} extension methods into {{CharSequence}} as well.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to