lua-users home
lua-l archive

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


On Wed, Jul 22, 2009 at 3:14 PM, Wesley Smith wrote:
> local C = {}
> local M
>
> local
> function setconstructor(m)
>        M = m
>        setmetatable(M, C)
> end
>
> module('myobject', setconstructor)

You can avoid the setconstructor callback since _M can be accessed
from the environment after calling module().