lua-users home
lua-l archive

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


2008/8/1 Tony Finch <dot@dotat.at>:
> On Thu, 31 Jul 2008, Christian Lindig wrote:
>>
>> Today, luac compiles multiple modules by prepending code that calls each
>> chunk (i.e. module). As a consequence, embedded 'requires' are executed
>> before all modules are executed. Is this behavior still useful in the
>> presence of 'module' and 'require'?
>
> It works OK for me if I present the modules to luac sorted so that all
> require calls occur after the corresponding module call.

That's why it's easier to only preload the modules. You can preload
them in any order, the actual loading will happen when necessary, when
first 'require'd.