|
Put this function at the top of your main module file: module("modname", package.seeall) function include(fname) local f = assert(loadfile(fname)) setfenv(f, getfenv(1)) f() end now you can use include("part1.lua") include("part2.lua") to include components. Note: 'local' functions and variables will not be visible outside of individual files, but you can build a module from multiple source files, and recursively include files. If you do not need to use recursive 'include' calls make 'include' a local function. Gé On Mar 6, 2007, at 12:17 PM, Norman Ramsey wrote:
-- Gé Weijers |