[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: New scoping rule for "repeat" and "continue" patch
- From: Rici Lake <lua@...>
- Date: Tue, 4 Oct 2005 20:14:19 -0500
On 4-Oct-05, at 6:06 PM, David Given wrote:
In C, continue does indeed jump to the end of the loop, just before
the test.
(I just checked it.)
Indeed it does. But in C, the following is illegal:
do {
int i = 1;
// ...
} while(i);
(Or, at least, it refers to a different 'i' than was declared inside
the loop.) So any 'continue' is in fact jumping to the end of the
scope, and then executing the test in the surrounding scope.
I'm not suggesting that it was a bad thing to change the scope of
'until': Diego has a good point about its utility. And Lua does not
have a 'continue' statement, so the discussion about what its semantics
might be is completely hypothetical, which doesn't make it less
interesting :)