lua-users home
lua-l archive

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

> In loadlib.c, ll_module attributes a new metatable to a module. Wouldn't
> it be nicer to check for a previously assigned MT first?

It checks for a _NAME field. It assumes that, if the module does not
have this field, it was not initialized, and therefore also does not
have a metatable. (Conversely, if it does have that field, it is
not initialized again and does not get a new metatable.)

-- Roberto