lua-users home
lua-l archive

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


On Thu, 1 Jul 2010 23:51:22 +0400, Alexander Gladysh <agladysh@gmail.com> wrote:

>> same here. ?i really don't like the 'seeall' option to module()
>
> In my current engine it is forbidden to create and access new globals.
...
> The other allowed global is an import() function (a wrapper around
> loadfile() with cache).

(Apologies to all for two Darwin messages in one day...)

I do the same kind of thing with Darwin
(http://lua-users.org/wiki/JimJennings) as you do with import.  I
don't lock down new global creations, though, because Darwin allows
each module to use 'strict' independently of what other modules and
main programs do.

As a result, if you write code with 'strict' or with a global
metatable like yours that prevents creating new globals, your code
will run in that environment under Darwin, while other code does not
have to run under the same rules.

Jim