lua-users home
lua-l archive

Re: upcoming changes in Lua 5.2 [was Re: Location of a package]

[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 ...

AltStyle によって変換されたページ (->オリジナル) /