lua-users home
lua-l archive

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

Hi all,


I’m not sure I understand the 5.1 documentation so can someone verify the following for me?

I’d like to read a Lua script, compile it with lua_load(), and then have it around to re-use in any number of future states.  So I create a first lua_State handle, compile the script with lua_load(), then use lua_dump() to get the compiled version back out and discard this lua_State.


Then for each future lua_State I create, use lua_load() but this time pass the output of lua_dump() as its input, and then use lua_pcall() to execute it.

Does that sound right?