lua-users home
lua-l archive

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


Am 10.08.2015 um 20:53 schröbte Milind Gupta:
Hi,
Hi!

          I added a simple package.searcher function in Lua 5.3 as follows:

package.searchers[5] = function(...)

local t = {...}
print(#t,t[1])

end

but now when I do require("nonexistentmodule") then I don't see this
function being called. How are the searchers supposed to work with require?
Your code works fine here (meaning it prints `1    nonexistentmodule` 
before `require` errors out). Same with Lua 5.2.
Thanks,
Milind

Philipp