lua-users home
lua-l archive

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


>Given a lua table it can write it to a persistant form (a string) which
>can be stored on a disk or pushed across a network. And given that string
>it can turn it back into a lua table. This works even if the table contains
>a hierarcy of other tables. And even if there are loops in the links between
>the tables. It doesn't work if any of the tables contain functions or 
>userdata though.

Very nice.
The way I want to do persistance is by saving precompiled code, but I never
find the time to do it.

Some comments:

 If the Lua function source was stored by the vm,
 storing structures with lua functions would be possible. 

It does, if the functions are defined via dostring instead of dofile.

 I'm not sure that "[[ ]]" will work in all cases. 

Then use format("%q",...) instead.
--lhf