lua-users home
lua-l archive

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


On 18 October 2011 22:14, Petite Abeille <petite.abeille@gmail.com> wrote:
>
> On Oct 18, 2011, at 10:27 PM, Krunal Rao wrote:
>
>> In a sense I would phrase the question as: what is wrong / needs to be
>> improved with the approach I mention above that requires additional
>> code / functionality?
>
> Well... just about everything that module offers today... so... given the outline under "15.4 The module Function":
>
> 1: local modname = ...
> 2: local M = {}
> 3: _G[modname] = M
> 4: package.loaded[modname] = M
> 5: setfenv(1, M)
>
> That would be 1, 2, 4 & 5.
>
> Other functionalities such as "reopening a module already created" a la Objective-C category is handy as well.
>
> Systematically setting _M and _NAME is welcome also, practically speaking.
>
> In short, all the functionalities of module circa 5.1  (short of messing with _G).
>
> Lua 5.2 value proposition is: stick to the basic form and wave goodbye to anything more sophisticated out-of-the-box.

I'm afraid this has always been the Lua philosophy.

Regardless, I don't believe you answered my last email that was an
attempt at a constructive discussion about this. Arguing about whether
it should be in/out is going in circles.

Can you say clearly exactly what aspects of module() you are in love
with? (and don't say all of them, because then I'll really have to
believe you're just trolling for fun :) ).

Regards,
Matthew