lua-users home
lua-l archive

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


> In 5.1, one can easily bundle multiple modules per Lua file, or
> concatenate multiple modules into one file, or package the entire
> enchilada in one binary file, courtesy of luac, without any fuss.

In Lua 5.2, I think you can easily write something like the following,
for multiple modules in one file:

do   -- Module 1
  local _ENV = mymodule("mod1")
  ...
end

do   -- Module 2
  local _ENV = mymodule("mod2")
  ...
end

where 'mymodule' is a somewhat trivial function.

-- Roberto