lua-users home
lua-l archive

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


Hello,

I have got different Lua scripts, that have all the same structure. The scripts have got four functions, but two of the functions are optional eg:

function init( ... )
end

function iterate( ... )
end

and optional

function event( ... )
end

function destroy( ... )
end

All scripts have got these functions, so I would read all scripts into one Lua state, so that I can call each script
 like :

script1.init
script2.init
script1.iterate
...

How can I read the Lua script and push the Lua functions into a nested table? Or is there a better way to do this structure?

Thanks

Phil