lua-users home
lua-l archive

Re: Lua 5.4: question about label visibility rule

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


> In the Lua 5.4 docs it says the following.
> 
> A label should not be declared where a label with the same
> name is visible, even if this other label has been declared
> in an enclosing block.
> 
> I have found the following test in the Lua 5.4.3 Test Suite (available
> here: http://www.lua.org/tests/), in the file goto.lua (starting line
> 223):
> 
> [...]
> 
> In this function the label ::l1:: is declared twice, once in the
> "elseif a == 4" clause and once at the end of the function. In my
> understanding, the second declaration of this label is visible at the
> point where the first declaration is made. That would contravene the
> rule I have quoted above.
> 
> This must mean that I am misunderstanding the meaning of the quoted
> rule. Could anyone please help me understand it?
REMEMBER: "The test suite is not a product; it is just a tool for our
internal use." (Third paragraph in http://www.lua.org/tests/)
-- Roberto

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