[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: lexical scoping
- From: Edgar Toernig <froese@...>
- Date: Fri, 07 Sep 2001 22:45:40 +0200
Roberto Ierusalimschy wrote:
>
> Simply like this:
>
> for k, v in tab do
> local v = v
> actors[k] = function (x) act_on(v, x) end
> end
Just a question: would the line "local v=v" be necessary or would
you only get a different semantic without it? (Without it, all v's
in the function are the same var, with the local line each function
gets it's own v.)
Ciao, ET.
PS: I'm really curious on how you implement these new scoping
rules without loosing performance.