lua-users home
lua-l archive

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


Yes it was for the same than above.
I need to have a main state and at many time I want to clone it, load
some user script and activate some actions on it. If computation is Ok I
get results to reapply to main state  and I kill cloned script.
So I have some bonus 
	- this run like a transaction with commit rollback.
	- I can control modifications on main state
	- I have not main state memory grows up.
	- User Script don't stay in memory after use.

PS: I use Lua 4.0, so please could you tell me if I can do it easilly
with Lua 4.1
Ignacio Castaño a écrit :
> 
> Luiz Henrique de Figueiredo wrote:
> > >Is there a way to clone a State.
> >
> > No. Why do you want to do this?
> 
> I went in a situation where that would be useful. I set up a lua state, and
> then loaded a module that used that state and could modify it. After that I
> wanted to return to the previous save state. I just resolved that in a
> different way, but cloning the state would have been useful.
> 
> Ignacio Castaño
> castano@asidesoft.com
> 
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com