Re: Module metatable
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Module metatable
- From: Roberto Ierusalimschy <roberto@...>
- Date: 2005年2月21日 15:23:37 -0300
> 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