lua-users home
lua-l archive

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


>I would have expected local variables to be valid and in
>scope when calling lua_dostring within a line hook.

Code run with lua_dostring is stand-alone code: it does not know anything
about being run within a line hook.

Try this: Create a table with the active locals at that point and set
it as the global table for running the code you run with lua_dostring.
Also, set an __index method (or index tag method) for this global table
to get things from the real global table.
--lhf