lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Tue, Jan 19, 2010 at 8:41 AM, Mark Hamburg <mark@grubmah.com> wrote:
> The summary is "functions don't have environments, call frames (activation records) have environments". (Calling a function preserves the current environment. in-do-end temporarily changes the current environment.)

So any function called from in-do-end effectively uses the new
environment. And then for subsequent calls? Does it propagate?

>  Certainly it probably pushes harder for using other mechanisms like upvalues to share private data since everything you call will by default be able to see the same globals you can see.

That's a big difference. So lookup is first current environment, then global?

steve d.