On Fri, 09 Dec 2011 01:20:45 -0500, Kagamin <s...@here.lot> wrote:
On Thursday, 8 December 2011 at 17:18:57 UTC, Joshua Reusch wrote:
Ahem. So are you suggesting that (a,b) means a tuple
everywhere but in a
for loop, where it is used to separate two statements?
If we use the comma operator only for tuples, there needn't to
be a special case for loops:
for(x, y = 0 , 100; x < y ; x, y += 1,-1) { ... }
for(int x, y = 0 , 100; x < y ; x, y += 1,-1) { ... }
?
Here's how I understood it:
int x,y; // Defined somewhere in the code above
for( (x,y) = (0,100); x < y ; (x,y) += (1,-1) ) { ... }
So you have variable capture, assignment and add-assign happening.