[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [poll] require & binary module interfaces
- From: HyperHacker <hyperhacker@...>
- Date: Thu, 21 Oct 2010 12:44:12 -0600
On Thu, Oct 21, 2010 at 00:23, steve donovan <email@example.com> wrote:
> On Thu, Oct 21, 2010 at 6:40 AM, HyperHacker <firstname.lastname@example.org> wrote:
>> 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.
> Ah, but there are always optional modules (maybe the submodules are
> rarely-used/big) so I would not expect this in general.
> However, I use fake loading with Penlight, so that the lazy way is to
> say require 'pl' and then the submodules become available when they
> are accessed. This way, the user only loads what they need, without
> having to keep track of loading the individual packages, unless they
> are being careful (e.g. if writing a module) when the explicit way is
> available and recommended.
> steve d.
Large/rarely-used modules are why I suggested using metamethods to
only load the module when someone tries to use it. __index on 'space'
would do here.
Sent from my toaster.