lua-users home
lua-l archive

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


Hi,

The problem with the hypothetical continue is not that "done" is "left
uninitialized" in the sense that it is "still nil". It doesn't exist
at all; the slot which it will occupy has been used by Lua as a
temporary in the call to l:match, and consequently it will have a
random value (which is probably *not* a false value) so that the
loop will exit prematurely. You'd have to actually install the
continue patch to see that happen, I supppose.

I don't see this as a fundamental problem. More like an implementation
bug with the continue patch now that the scoping rule of the repeat
loop has been changed. Surely it wouldn't be impossible to make sure the
slots of locals used in the until expression were reserved a priori if
there is a continue statement that can jump across their declarations.
Would this be more complicated? Yes. But still, it's the continue's
implementation's problem, not the scoping rule's problem.

Regards,
Diego.