lua-users home
lua-l archive

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


Is there an equivalent for Python's

if __name__ == "__main__":
   main()

in Lua?

For example, something like this? (If not, is this something that could be added in the next release?)

if _MAIN then
 ...
end

where _MAIN would be true if the script is run directly, and false if it is part of require or dofile.

TIA
Tony.