[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua 5.1 threads, environments, and 5.2
- From: Sam Roberts <vieuxtech@...>
- Date: Sun, 10 Apr 2011 20:11:27 -0700
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