lua-users home
lua-l archive

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


On Mon, Oct 17, 2011 at 11:43 AM, Petite Abeille
<petite.abeille@gmail.com> wrote:
>
> On Oct 17, 2011, at 2:33 AM, Josh Simmons wrote:
>
>>  When replaced by the arduous few lines
>> required in 5.2 the semantics are clear to anybody with a basic grasp
>> of Lua constructs.
>
> Right. Looking forward to the avalanche of very pointed questions about what the (*&^(%*$%$# that magical _ENV thingy is. Remember, ipairs is apparently over the top already.
>
>
>

Not sure why you think the problem with ipairs was magic, it was just
deemed (for a little while at least) unnecessary.

_ENV is a core construct of Lua, something you're going to have to
understand eventually anyway, it's not a restrictive single purpose
function replaceable with ~3 lines of trivial Lua in your module file
where the latter also provides more useful and obvious semantics.

I'd also note that it's not necessary or beneficial to touch _ENV at
all in your module unless you're doing something weird.