Re: Feedback on ForStatement

Jochen Theodorou <[email protected]>
Newsgroups gmane.comp.lang.groovy.devel
Message-ID <[email protected]>
On 06.02.26 17:30, Milles, Eric (TR Technology) via dev wrote:
>> How does one distinguish between an absent value and a value of null 
> (e.g., as a list element)?
> 
> In the current ForStatement:
> 
> "for (i, x in y)"
> getIndexVariable() returns i (or null if "i," is omitted)
> getValueVariable() returns x
> getCollectionExpression() returns y
> 
> "for (int i = 0; i < n; ++i) ..."
> getIndexVariable() returns null
> getValueVariable() returns null
> getCollectionExpression() returns a ClosureListExpression that contains 
> all of "int i = 0; i < n; ++i" — why it's called "closure list" must be 
> a legacy thing

How does this all work if more than one variable is defined?

bye Jochen
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.