[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Organizing sources
- From: steve donovan <steve.j.donovan@...>
- Date: Fri, 6 Jul 2012 08:50:29 +0200
On Fri, Jul 6, 2012 at 5:17 AM, <email@example.com> wrote:
> sourcing the code into a main file like done with unix shell scripts?
> Are there other ways?
Absolutely, and they work better than simply 'sourcing' the code (as
the C preprocessor does as well).
The function you need to understand is require()
The short answer: require() is like dofile(), in that the source is
separately compiled, but it looks up the source on the _module path_.