lua-users home
lua-l archive

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


2011/10/18 Sam Roberts <vieuxtech@gmail.com>:
> On Mon, Oct 17, 2011 at 9:07 AM, Petite Abeille
> <petite.abeille@gmail.com> wrote:
>>
>> On Oct 17, 2011, at 4:28 PM, Javier Guerra Giraldez wrote:
>>
>>> module() is gone,
>>
>> It's not gone. It's alive and kicking in 5.1.
>>
>> 5.2 is not released. In 5.2, it might  be deprecated. Which means it's going to be there for years to come.
>>
>>> the replacement is far simpler,
>>
>> Bollox :)
>>
>>> I really don't get why to keep discussing about it.
>
> Because module and require worked fine, and provided a common way to
> implement modules.
>
> Now we are trying to support two ways, check out this code at about line 60:
>
> https://github.com/dcurrie/lunit/blob/master/lunit.lua
>
May be this will be better:

if _VERSION == 'Lua 5.2' then
    lunit = {}
     _ENV = lunit
    package.loaded[...] = lunit
end


then you needn't to return lunit table.