I (and possibly others before me) have already requested this, and the
consensus (of the few that answered) was something like “no, we don’t
really need that”.
I too strongly feel this is something that should be part of Lua but I
believe getting features into Lua is a mixed process of “(visible)
democracy” (what the majority of the minority-that-replies want) and
“oligarchy” (the actual Lua authors).
So, don’t hold your breath! :)
*From:* Ashish Ranjan <mailto:ashishwave@yahoo.com>
*Sent:* Sunday, September 21, 2014 5:45 AM
*To:* lua-l@lists.lua.org <mailto:lua-l@lists.lua.org>
*Subject:* PossibleSpam(9.169):[Feature request]: analogous to --- if
__name__ == “__main__”: ---- of python in lua modules
FEATURE REQUEST: In python , we have a construct
if __name__ == “__main__”:
so that if a module .lua file is executed by itself then this code block
executes, but if this module is imported(required() as in lua) by other
script file, then this code blosk is not executed.
Can we have this construct in lua. This will be an important step in
life of a lua module.
Kindly see for better explanation http://stackoverflow.com/a/20158605
Ashish Ranjan
ashishwave@yahoo.com