lua-users home
lua-l archive

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


Alexander Gladysh <agladysh@gmail.com> writes:
> It is a permanent TODO item for us to split chunks off lua-nucleo and
> put them to nice separate library. But so far there was little
> progress on the matter. Perhaps next year... or rather when someone
> would ask for something nice from it to reuse (like maybe
> tstr/tserialize).

I agree it's a bit tricky ... I too accumulate all this stuff which
seems useful and I think "hmm, maybe I'd like to share" but ... really
doesn't fit so well anywhere...

I dunno....

Maybe instead of swiss-army-knife packages, some sort of "micro
module" concept, with single-function (or just a few functions)
modules in some clever namespace and an easy tool to keep your app's
"micro module set" updated from a central repo...

Hmmm well one of the annoyances of using too many modules is that you
accumulate vast numbers of require lines at the front of your source
files, and it would be nice to avoid that for such "micro" modules...


maybe something like this:

   -- snogglethorpe is me
   local snog = require "micromod.snogglethorpe"
   local agladysh = require "micromod.agladysh"

   print (snog.string.some_clever_func1 ()
          + agladysh.numeric.some_clever_func2())

... relying on __index magic to dynamically load/add the
sub-namespaces and functions, and some tool that can scan your source
files and keep the module directories updated...

argh

anyway... I'm also wary of positing too much clever infrastructure --
the simple nature of most Lua modules is very appealing -- but maybe
there's some sweet spot where everything could just kinda work....

-miles

-- 
「寒いね」と話しかければ「寒いね」と答える人のいるあったかさ [俵万智]