lua-users home
lua-l archive

Re: Can a Lua module find out whether it is being required or dofiled?

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


> - require will pass the module name to the file chunk as argument
Since Lua 5.2, require also passes the path to the file:
% cat m.lua
print("args",...)
% lua -lm /dev/null
args	m	./m.lua
% lua m.lua
args

AltStyle によって変換されたページ (->オリジナル) /