|
On 09/22/2014 08:22 PM, zzf wrote:
No, you have taken it wrong -- the _NAME field of the module is set by the module itself, not by Lua.
in lua module
if _NAME == nil then
test()
end
equals
if __name__ == “__main__”:
like this:
Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio
> require('md5')
> print(md5._NAME)
md5
>
if the module does not set it, it won't be there.
if you check your md5.lua, you would probably see something like this:
~~~
module("md5", package.seeall)
_NAME = "md5"
_VERSION = <...>
_COPYRIGHT = <...>
<...>
~~~