lua-users home
lua-l archive

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


	Hi

Does anyone know if you can transfer (seamlessly) a variable or table
across LUA states?
	No.  But you can transfer some types of values using the C API.

Currently I have multiple states executing scripts
thoughout my application.  In some I have the need to have an almost
global feel to them, where one state would be modifying another states
variables.  The whole thing is not threaded (so no locking will be
necessary), and scripts are executed sequentially in an event like
system.
	Take a look at Rings library:

http://www.keplerproject.org/rings/

	Rings provides a function to create Lua states in Lua.  This
will create an object with a method called `dostring'.  This method
receives a piece of Lua code to be executed in the newly created state,
and can receive optional parameters, which will be stored in the `arg'
table (we'll release a version for Lua 5.1 very soon :-).

	Hope it helps,
		Tomas