[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: modules, require, magic
- From: steve donovan <steve.j.donovan@...>
- Date: Fri, 21 Oct 2011 07:42:33 +0200
On Thu, Oct 20, 2011 at 10:37 PM, Hisham <hisham.hm@gmail.com> wrote:
> With the module() + package.seebase variation suggested at [1] I think
> the only remaining drawback would be that all accesses to globals go
> all the time through function calls when using package.seebase.
That's why my solution suggested that the environment has a straight
__index=lua_libs, and the actual module is a copy of the environment
(whether constructed implicitly through __newindex or explicitly
through a table copy).
So, yes, there's still a little indirection, but not involving a function call.
It's true that _any_ module gets a fresh environment, although this
might be seen as a feature (strictly reducing use of global namespace)
steve d.
- References:
- Re: modules, require, magic, Petite Abeille
- Re: modules, require, magic, Sam Roberts
- Re: modules, require, magic, David Manura
- Re: modules, require, magic, Hisham
- Re: modules, require, magic, Roberto Ierusalimschy
- Re: modules, require, magic, Fabio Mascarenhas
- Re: modules, require, magic, Roberto Ierusalimschy
- Re: modules, require, magic, Hisham
- Re: modules, require, magic, Roberto Ierusalimschy
- Re: modules, require, magic, Hisham
- Re: modules, require, magic, Roberto Ierusalimschy
- Re: modules, require, magic, Hisham