You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Daniel Sun (Jira)" <ji...@apache.org> on 2021/04/11 05:44:00 UTC

[jira] [Commented] (GROOVY-9649) left-open and full-open ranges

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

Daniel Sun commented on GROOVY-9649:
------------------------------------

+1

> left-open and full-open ranges
> ------------------------------
>
>                 Key: GROOVY-9649
>                 URL: https://issues.apache.org/jira/browse/GROOVY-9649
>             Project: Groovy
>          Issue Type: New Feature
>            Reporter: Björn Kautler
>            Priority: Major
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> I found there are right-open ranges like {{1..<5}} for {{[1, 2, 3, 4]}}, but no left-open ranges and full-open ranges.
> I'd like to suggest adding those, e. g. {{1<..5}} for {{[2, 3, 4, 5]}} and {{1<..<5}} for {{[2, 3, 4]}}.
> For decimals it would be similar, just omitting the lower bound if it matches.
> Currently
> {{3.5..<5.7}} gives {{[3.5, 4.5, 5.5]}}
> {{3.5..<5.5}} gives {{[3.5, 4.5]}}
> So with my suggestion it would then probably be
> {{3.5<..5.5}} gives {{[4.5, 5.5]}}
> {{3.5<..<5.7}} gives {{[4.5, 5.5]}}
> {{3.5<..<5.5}} gives {{[4.5]}}



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