lua-users home
lua-l archive

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


> Quick question about having more than one state in lua:
> 
> I need a function like this:
> 
> BOOL CloneObject(lua_State *fromstate,lua_Object *O,lua_State *tostate);
> 
> that will clone my object O in fromstate to tostate. In my case I need
> to give a object from one thread to another, not as a refereable but as
> a cloned copy!
> 

you have to use the host to transfer the data from one state to the
other. so, you can implement such a function as long as the lua object
to be cloned hold only numbers, strings and userdata.

-- waldemar