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

Does/could Groovy support multiple variable definitions in for loop?

    XMLWordPrintableJSON

Details

    • Question
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 2.6.0-alpha-1
    • Compiler
    • None

    Description

      I ask this because it has been causing a lot of headaches when we convert Java files to Groovy. This form seems to fail and seems reasonably useful:

      for (int i = 0, n = list.length; i < n; i +=1) {
      

      It seems the definition of two or more variables in the for initializer is not supported.

      Attachments

        Activity

          People

            daniel_sun Daniel Sun
            emilles Eric Milles
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: