lua-users home
lua-l archive

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


On Wed, 23 Sep 2009 03:41:18 +0300, Shmuel Zeigerman <shmuz@013net.net> wrote:

> I thought of a solution, where the program assigns each user (that is,
> each group of scripts) a separate environment and calls those scripts
> within that environment. But AFAIK, there is no way to have a
> package.path per an environment, there is only one package.path.

On the lua-users.org wiki (http://lua-users.org/wiki/JimJennings), I
have posted an implementation of a module system extension (called
Darwin) that supports separate environments and has a package.path for
each environment.  Your request sounds similar to the intended use for
Darwin, which is to aggregate scripts
(libraries/modules/programs/whatever) from many sources but expose
them in a controlled way to the programmer (your users).

I'm not sure Darwin is the right solution for your problem, but you
might get some insight from looking at the documentation, which
contains examples.

--Jim