[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Short modules (was Re: [ANN] Cratable - Extended table module for Cratera)
- From: steve donovan <steve.j.donovan@...>
- Date: Tue, 21 Nov 2017 14:27:45 +0200
On Tue, Nov 21, 2017 at 1:48 PM, Dirk Laurie <dirk.laurie@gmail.com> wrote:
> expecting the user to make zillions of requires. Don't you do that
> with Penlight, Steve?
I do, but I got clever (for better or worse). "require 'pl'" does not
directly pull all those pl.* modules in, but loads them in a lazy way.
If you try to access a submodule like 'data' the code will be actually
loaded.
Personally, I think "require 'pl'" is fine for informal use, but for a
big apps, and definitely for modules, use the explicit "local data =
require 'pl.data'".
No cleverness and no globals, just more typing ;)