Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-416

support better stepwise iteration

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.0-beta-6
    • None
    • None

    Description

      We should add helper methods to Number to support this

      for (i in 10.step(1, 2))

      { ... }


      (i.e. provide one which doesn't take a closure and returns an iterator instead).


      Also we should offer a step() feature on ranges so we can do things like

      for (i in (10..1).step(2)) { ... }

      or

      (10..1).step(2)

      { ... }

      Attachments

        Activity

          People

            guillaume Guillaume Sauthier
            jstrachan James Strachan
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: