[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [poll] require & binary module interfaces
- From: steve donovan <steve.j.donovan@...>
- Date: Thu, 21 Oct 2010 08:23:45 +0200
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.