[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [poll] require & binary module interfaces
- From: HyperHacker <hyperhacker@...>
- Date: Wed, 20 Oct 2010 22:40:09 -0600
On Wed, Oct 20, 2010 at 22:36, Wesley Smith <email@example.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.
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.