lua-users home
lua-l archive

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

> This just depends on the formal parameters being declared in sequential
> order, so the second parameter shadows the first.
> When you write
> a,a = 1,2 return a
> there is no shadowing involved.  The order of assignment is undefined.
> When you write instead
> local a,a = 1,2 return a
> the second local declaration shadows the first, and the result is indeed
> 2.
> > While both variables have the same name, they are different, really,
> Not when you write a,a = 1,2.  That is the same variable twice.  With
> local a,a = 1,2 you get two different variables.

Right you are. I'd put 'local' in there only by error.

I've reread
meanwhile, where the bug i wanted to report is explicitly mentioned.
Thus the case is indeed dealt with and the glitch legal.

-- Lars