lua-users home
lua-l archive

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


>>Presumably, tag methods that I set in one state won't be set in a new state,
>>right?
>>If not, is there a "lua_copystate" function so that I can copy all the tag
>>methods I've set, types I've created and functions I've registered to a
>>newly created state?

Here's what you can do.  Install all your tags, files, and objects through
wrapper functions that record what is being installed as strings or
filenames then the original thread can spawn another and pass it a string
or filename to initialize itself.  Putting all the initialization into one
file and just telling the new thread (state) to call dofile on it would
seem to be cleanest.

Just a quick idea which is likely to have some flaws.

Russ