lua-users home
lua-l archive

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


Very interesting. Would it be possible to raise an error in this rather rare case? Although I imagine it would be hard to implement the checks in the compiler, I would consider continue worth the added complexity. For the record, I've found the 5.1 scope rule change handy in the past ;).

- Alex

----- Original Message ----- From: "Roberto Ierusalimschy" <roberto@inf.puc-rio.br>
To: "Lua list" <lua@bazar2.conectiva.com.br>
Sent: Monday, February 25, 2008 9:28 PM
Subject: Re: upcoming changes in Lua 5.2 [was Re: Location of a package]


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

-- Roberto