lua-users home
lua-l archive

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


In message <CABcj=tnG6e_zFBv+FgxR-jkd8xOCxkd8SA-WNUXAfj9mL+_NLg@mail.gmail.com> you wrote:

> > The scope of a local variable is the part of the smallest chunk
> > containing its declaration which follows it.
> 
> The manual does not bring chunks into the definition of scope.
> It says:
> 
>    The scope of variables begins at the first statement
>    after their declaration and lasts until the end of
>    the innermost block that includes the declaration.
> 
> Is the quoted definition equivalent to that?  Hardly.
> 
> The "smallest chunk containing its declaration" of a variable
> is just the declaration.  The part of it that follows the
> declaration is empty.  It's useless, but it is a chunk.

Apologies. All this time I have been equating "chunk" with "block".
So is it correct to say that the scope of a local variable is the
part of its smallest enclosing block that follows it?

I had better replace "(sub)chunk" with "(sub)block" in all my
documentation. 
-- 
Gavin Wraith (gavin@wra1th.plus.com)
Home page: http://www.wra1th.plus.com/