[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: question about local function closures
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Fri, 18 Feb 2005 22:01:37 -0200
> to my way of thinking "local a=b" and "local a; a=b"
> should always be equivalent.
Consider "local a=a". This would be useless in your interpretation but it's
actually a nice idiom for copying global or outer variables to local variables.
So, in "local a,b,c= A,B,C", the scope of a,b,c starts only after "C"
not after "=".
In other words, in the current interpretation you can implement what you want,
but not vice-versa. So Lua opts for flexibility in this case.
--lhf