lua-users home
lua-l archive

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


This has come up before, but I can't remember or find the answer.

Is there a test that allows the following logic?

----
if test then -- module was invoked by 'require'
  return module
end
-- continue with main program
----

The best I can come up with is to insist on 'lua -i' for the
standalone, and use os.exit if I don't want to fall back to Lua.