lua-users home
lua-l archive

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


Florian Weimer <fw@deneb.enyo.de> writes:

> * Roberto Ierusalimschy:
>
>>> > The reference manual clearly states:
>>> >
>>> >> A label is visible in the entire block where it is defined (including 
>>> >> nested blocks, but not nested functions). 
>>> 
>>> And I think this is a mistake, both in implementation and in
>>> specification.
>>
>> What is the mistake? What change would you suggest?
>
> Labels should have non-lexical scope, extending across the whole
> function, and the same label must not be used twice within the same
> function.

What is "the whole function"?  Chunks exist outside of functions, and
functions can be nested.  What kind of "non-lexical scope" are you
asking for?  Should labels be accessible to called functions in
different lexical scope?  Why would that be a good idea?

-- 
David Kastrup