lua-users home
lua-l archive

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


On Sat, Apr 9, 2011 at 12:37 AM, Anthony Howe <achowe+lua@snert.com> wrote:
> Q: Essentially how to force Lua application & library functions to
> inherit the environment of the thread or caller (not the environment of
> where it was defined).

lua functions (etc.) have the environment at their point of
definition, not of call. Its part of lexical scoping, what you
describe sounds like dynamic scoping, which is pretty useful, but not
lua.

> In 5.1 I can almost get this to work partially with environments, while
> in 5.2 alpha documentation, section 8.1 "Threads do not have individual
> environments. All threads share a single fixed environment." - which
> seems to destroy the idea of the thread being an object / sub-class of
> the master state.

I've followed your requests,  but I don't recall you ever saying
explicitly what you have "working partially" or what you are trying to
do, making it hard for anybody to really help (other than the lua
authors changing how 5.2 works, which isn't very likely).

I'm curious, but so far have no idea what to suggest. What is the
problem you are trying to solve?

Cheers,
Sam