lua-users home
lua-l archive

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


Roberto Ierusalimschy wrote:
Now, consider the addition of 'continue':

  repeat
    ...
    if something then continue end
    ...
    local x = ...
    ...
  until something-with-x

We have two options: either the continue jumps into the scope of 'x'
bypassing its declaration/initialization (very bad), or the continue
skips the test altogether (very bad too).

So, it seems that continue is incompatible with this scope rule...

What would happen if someone wrote:

  repeat
    ...
    if not something then
       local x = ...
    end
    ...
  until something-with-x

Existing code would not break until someone adds a 'continue', then its not existing code ...