[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Transfering tables and variables across LUA states?
- From: Tomas <tomas@...>
- Date: Thu, 16 Mar 2006 12:32:16 -0300 (BRT)
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
Take a look at Rings library:
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,