You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "John Wagenleitner (JIRA)" <ji...@apache.org> on 2017/03/01 18:44:45 UTC
[jira] [Commented] (GROOVY-8102) Does/could Groovy support multiple
variable definitions in for loop?
[ https://issues.apache.org/jira/browse/GROOVY-8102?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15890775#comment-15890775 ]
John Wagenleitner commented on GROOVY-8102:
-------------------------------------------
I believe this is supported in the anltr4 "parrot" branch that is planned for an upcoming major release.
https://github.com/apache/groovy/blob/35ec2156e3356f85a666c71ba3d3df3bf74c81ae/subprojects/groovy-parser-antlr4/src/test/resources/core/For_05x.groovy
> Does/could Groovy support multiple variable definitions in for loop?
> --------------------------------------------------------------------
>
> Key: GROOVY-8102
> URL: https://issues.apache.org/jira/browse/GROOVY-8102
> Project: Groovy
> Issue Type: Question
> Components: Compiler
> Reporter: Eric Milles
> Priority: Minor
>
> 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:
> {code}
> for (int i = 0, n = list.length; i < n; i +=1) {
> {code}
> It seems the definition of two or more variables in the for initializer is not supported.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)