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:56:00 UTC

[jira] [Created] (GROOVY-10032) CLONE - left-open and full-open ranges (consider adjusting containsWithinBounds behavior)

Paul King created GROOVY-10032:
----------------------------------

             Summary: CLONE - left-open and full-open ranges (consider adjusting containsWithinBounds behavior)
                 Key: GROOVY-10032
                 URL: https://issues.apache.org/jira/browse/GROOVY-10032
             Project: Groovy
          Issue Type: New Feature
            Reporter: Björn Kautler
            Assignee: Paul King
             Fix For: 4.0.0-alpha-3


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)