[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: I'd give my right arm for a continue statement
- From: T T <t34www@...>
- Date: Sun, 23 Jan 2011 14:40:54 +0000
2011/1/23 GrayFace <sergroj@mail.ru>:
> On 23.01.2011 17:35, David Kastrup wrote:
>>
>> I seem to remember that this was basically considered a scope problem
>> since "continue" in a repeat-until, when implemented C-like, was
>> supposed to reevaluate the loop condition, and the loop condition could
>> refer to local variables introduced after the call of continue.
>>
>> My take on this had been that the C behavior is undesirable anyway and
>> that continue in a repeat-until loop should reiterate _straight_ from
>> the top of the loop without checking the _finishing_ loop condition.
>>
>> While not "C-like", this would be much more useful, as well as rendering
>> the scoping problem irrelevant.
I would be also very interested to hear what Lua creators think about
it. Could we have an official word on this? Are there any
show-stoppers preventing adding the 'continue' construct with the
above semantics?
> 'Continue' checks conditions of all other loops, so it would be very very
> strange if it's different for repeat..until. Not to mention all other
> languages.
Then it could be named 'reloop' instead of 'continue' or whatever else
is deemed appropriate. This is really of secondary importance to this
discussion.
Cheers,
Tomek