[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: question about local function closures
- From: Russell Smith <russ.ls@...>
- Date: Fri, 18 Feb 2005 16:08:33 -0800
ahhhh... this makes perfect sense. thanks!
russ.
On Fri, 18 Feb 2005 22:01:37 -0200, Luiz Henrique de Figueiredo
<lhf@tecgraf.puc-rio.br> wrote:
> > 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
>
--
Russ Smith
http://www.q12.org/