lua-users home
lua-l archive

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


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