> On Tue, Mar 31, 2009 at 4:15 PM, Tom Miles <Tom@creative-
> > Urm, how to put this another way...
> > When I create a state, I load an associated script file. I want to
> > some variables into the state the script is running in that are only
> > visible to that script. I can add globals using lua_setglobal(L,
> > "myvar"), or even lua_setfield(L, LUA_GLOBALSINDEX, "myvar"), but
> > doesn't seem to be an equivelant for locals.
> Use a custom loader to prepend "local A,B,C,D,E = ...;" to the input
> (where A through E are the names of the locals you want), then before
> doing a pcall on the script, push the values of the locals onto the
> stack and adjust the nargs value of the pcall.