[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- 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, <meino.cramer@gmx.de> 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()
http://www.luafaq.org/#T1.19
The short answer: require() is like dofile(), in that the source is
separately compiled, but it looks up the source on the _module path_.
steve d.