[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: from: Lua Module Function Critiqued
- From: Andrew Starks <andrew.starks@...>
- Date: Wed, 9 Oct 2013 13:14:18 -0500
On Wed, Oct 9, 2013 at 12:55 PM, Luís Eduardo Jason Santos
<jasonsantos@gmail.com> wrote:
>>
>> Sigh...
>
>
> Sigh indeed.
All of this is relevant to backporting, correct?
My strategy when writing for 5.2:
I have a toolkit that I often `require` in the first line of my module:
_ENV = require'my_toolkit'
The toolkit is a collection of other modules and standard libraries.
For anything that I monkey-patch, I deepcopy the module/table, making
my changes to the copy.
As a result, I don't have access to the global environment and that
global environment stays stock-Lua, unless the consumer does something
to change that.
If this approach doesn't contain surprises that I'm not seeing, then I
believe that it is equivalent to the intent of `module`, and thus I
can safely ignore the on-coming debate about module. :)
Correct?