[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Scopes, and Named Parameters?
- From: io219@...
- Date: Thu, 9 Jan 2003 10:44:56 -0600
Also... I remember the local/global thing now...
--> Thursday, January 9, 2003, 9:11:13 AM, you wrote:
> function f(t)
> local a,b,c=t.a,t.b,t.c
> ...
> end
>>Finally, I can't remember specifically but wasn't there some unpopular
>>global vs local default scope issue that was going to be changed?
>>I think it was simply that local would be implicit instead of global.
> The solution adopted in Lua 5.0 is that every function (including the "main"
> function in each chunk) has its own table of globals, which can be changed.
> With adequate metamethods set for these table of globals, you can have a
> sort of implicit declaration of locals, flag writes to global variables,
> and much more.
In your function f I left above, currently the local keyword is require to
keep a,b,c from going into the global scope. Is that ever going to change?
-Toyotomi