lua-users home
lua-l archive

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


Brian Chin wrote:
I'm making a game system, in which I require to save the internal state of the Lua virtual machine. For stuff like C++, this is normally fairly easy, since it's just data. However, in Lua, closures are a pain to serialize. Has anyone ever had to do something similar, and if so can you give me any hints as to this problem?

I'm not sure if it applies exactly to your problem, but I made a small patch to Lua 4.0 that allows you to retrieve C function closure values. With a small change it can access Lua function closures also. See http://lua-users.org/wiki/LuaPowerPatches.

-John

--
OpenPGP encrypted mail welcome.