lua-users home
lua-l archive

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


On Wed, Oct 20, 2010 at 22:36, Wesley Smith <wesley.hoke@gmail.com> wrote:
>> require("space.vec3") should work fine by itself using the all-in-one
>> loader if your module is space.so and has both luaopen_space and
>> luaopen_space_vec3 functions exported. See the refman entry for
>> package.loaders for details.
>>
>> It won't (on its own) load the space module though so you'll need to make
>> sure your luaopen_space_vec3 function requires the space module if it
>> needs it.
>>
>
> oof.  You're right!  For some reason I thought I had tried that and it
> didn't work.  Nice to know that it does.  Glad I asked :)
> I'd still like to know whether people expect all modules inside a
> binary to be loaded by loading the base module or expect the
> piece-meal approach.
>
> wes
>
>

I'd expect them to be loaded or at least fake it with metatables (load
space.vec3 when I first access it). If I load a module I expect that
all of its functionality - including that which may be in a sub-module
- is available.

-- 
Sent from my toaster.