[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: require+localizing=frustrating (was Re: Idea for a new kind of require)
- From: Sam Roberts <vieuxtech@...>
- Date: Tue, 28 Aug 2012 12:49:29 -0700
On Tue, Aug 28, 2012 at 12:40 PM, Patrick Donnelly <batrick@batbytes.com> wrote:
> Because the library is stored in a global, all subsequent access would
> be correct. This quickly deteriorates into a situation where the
> script writer depends on a library which depends on another library
> that the script uses incidentally but forgets to require:
Did you consider loading every script into its own environment, so its
"globals" go into a table just for it, rather than _G?
You'd have to modify require to understand this convention, but it
would allow people to not do explicit local, and still get script
isolation.
Sam
- References:
- Idea for a new kind of require, Rob Hoelz
- Re: Idea for a new kind of require, Duncan Cross
- Re: Idea for a new kind of require, Rob Hoelz
- Re: Idea for a new kind of require, Duncan Cross
- Re: Idea for a new kind of require, Rena
- Re: Idea for a new kind of require, Javier Guerra Giraldez
- Re: Idea for a new kind of require, Rob Hoelz
- Re: Idea for a new kind of require, Rob Hoelz
- Re: Idea for a new kind of require, Doug Currie
- require+localizing=frustrating (was Re: Idea for a new kind of require), Jay Carlson
- Re: require+localizing=frustrating (was Re: Idea for a new kind of require), Dirk Laurie
- Re: require+localizing=frustrating (was Re: Idea for a new kind of require), Patrick Donnelly