lua-users home
lua-l archive

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



On 27 Jan 2011, at 14:42, Roberto Ierusalimschy wrote:
In Lua, we cannot have traditional labels, because the syntax "foo:"
already has a different meaning. Instead, a simple syntax would be to
add labels only to "do end" blocks, for instance like this:

If I understand this correctly, old 'break' (without labels) would became superfluous as it would be mainly a sugar to break a hidden 'do ... end' around the innermost loop, like:

do :hidden:
 while condition do
   ...
   break :hidden: -- same as 'break'
   ...
 end
end

If that's the case, would 'break' without labels still be supported (one more thing to learn, document, etc.)? Or maybe become a deprecated feature?


--
Renato Maia
Computer Scientist
Tecgraf/PUC-Rio
__________________________
http://www.inf.puc-rio.br/~maia/