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

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

    Details

    • Type: Question
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.6.0-alpha-1
    • Component/s: Compiler
    • Labels:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: