lua-users home
lua-l archive

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

On Tue, Mar 2, 2010 at 1:43 PM, Nicolas <> wrote:
> My game currently handles its savefiles as a serialization of the running
> objects, since some objects can have functions dynamically attached to
> them it needs string.dump to serialize them and later reload them.

The alternative approach to serialising a function is to use the debug
API to get the filename and line number where it was defined, then
load said file, pull out the actual code, and thus save the source
code rather than bytecode.