[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lua-l
Subject:    Re: bug report: LUA compiler glitch
From:       Lars Doelle <lars.doelle () on-line ! de>
Date:       2011-08-10 12:18:13
Message-ID: 201108101418.13860.lars.doelle () on-line ! de
[Download RAW message or body]


> 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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic