lua-users home
lua-l archive

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


Thanks very much Javier

Information is finally starting to penetrate through my skull!

Would this be a useful layout:
files === main.lua, localsCollector.lua, library.lua

---untested pseudo code-----
localsCollector.lua file:

local maintable = {}

do
dofile(library.lua)--library.lua has local table A
maintable.A = A
end

repeat adding more local tables to maintable....
end

return maintable

then I could bring maintable into main.lua with another dofile()

Thanks to your code, I'd have one big table with several nested tables that are private to one another.

Every time I add a local table to maintable I am not assigning new variables right? but just referring to the ones defined in another scope?

There seems to be some differences of opinion about modules, would this layout work and allow me to dodge the module debate?

Thanks again for your time-Patrick