lua-users home
lua-l archive

Re: modules, require, magic

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


On Oct 18, 2011, at 1:53 AM, David Manura wrote:
> On Mon, Oct 17, 2011 at 1:00 PM, Sam Roberts <vieuxtech@gmail.com> wrote:
>> 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
> 
> That's ugly, though not necessary either. I would, like Luiz, avoid
> using both _ENV and 'module' for module definition.
Of course it's not necessary for new modules. I avoid both _ENV and 'module' for any new modules I create. The challenge is trying to maintain maximum compatibility with uses of existing modules, such as lunit, in large code bases, with both Lua 5.1 and 5.2. 
e

AltStyle によって変換されたページ (->オリジナル) /