lua-users home
lua-l archive

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]


In a program, one can say
mymod = require "mymod"
or
mymod = dofile "mymod.lua"
Is there any way that the code of "mymod.lua" can distinguish
between these?

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