lua-users home
lua-l archive

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


> On Thursday, February 11, 2016 at 10:26AM, Soni L. wrote:
>> On 11/02/16 10:25 AM, Dirk Laurie wrote:
>> >No censorshop: LuaRocks can still accept any module via the present
>> >uploading protocol. Only, if they're nonstandard they can be installed
>> >but re not on the good guys list.
>> >
>> What about modules which return functions?
>
> I'm not sure what you mean: modules can return *both* functions and items
> like __AUTHOR = "Terrific Coder". All of mine do.

I think he's talking about modules that return a function instead of a table.

For instance, a module you use like this:

    (require "m")(arg1, arg2)

My answer to that is: don't return a function, return a table with a
__call metatable.

-- 
Pierre Chapuis