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

[jira] [Comment Edited] (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=17319356#comment-17319356 ] 

Paul King edited comment on GROOVY-9649 at 4/12/21, 10:51 AM:
--------------------------------------------------------------

Proposed PR merged with a minor tweak for a conflict. Thanks all involved! I think we should do some more work around this, e.g. inconsistent {{containsWithinBounds}} behavior, but we can do that as separate issues.


was (Author: paulk):
Proposed PR merged with a minor tweak for a conflict. I think we should do some more work around this but we can do that as separate issues.

> 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
>            Assignee: Paul King
>            Priority: Major
>             Fix For: 4.0.0-alpha-3
>
>          Time Spent: 2h 40m
>  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)