lua-users home
lua-l archive

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


Norman Ramsey writes:
> I'm building a fairly large package consisting of a mix of C code and
> Lua code.  Following previous advice I've made the C code a submodule,
> which is working well.  But this is going to be a large package (probably
> 2000-3000 lines of Lua code), and while there are several well-defined
> submodules in the package, some of the submodules (such as the module
> containing all the package-specific commands intended for clients) are
> too large to put in one file.  So, I would like to have multiple
> files, each loaded with 'require', that all contribute to the same
> submodule.
> 
> Does anyone have advice about sensible ways to do this?
> (I have several ideas but feel I am treading on thin ice...)

This is pretty easily achieved by doing what you say.  Have a real
module that is public, so to speak.  Within that you can "require"
all your component files, none of which are modules, just plain files
with functions in them.  All the functions in your small files then
become part of your overall module.

Robby

--
r dot raschke at tombob dot com