lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


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.

'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. As I remember reading in one of such threads, 'continue' patch already issues an error if 'continue' may skip declaration of a variable that's used in 'until' condition. My memory may be failing me about the patch, but I think this behavior is *the* solution and the whole continue-repeat clash is a non-issue.

--
Best regards,
Sergey Rozhenko                 mailto:sergroj@mail.ru