[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: bug report: LUA compiler glitch
- From: Lars Doelle <lars.doelle@...>
- Date: Wed, 10 Aug 2011 14:18:13 +0200
> 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 http://lua-users.org/lists/lua-l/2006-06/msg00376.html
meanwhile, where the bug i wanted to report is explicitly mentioned.
Thus the case is indeed dealt with and the glitch legal.
-- Lars