[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: How to query current path from a library?
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Mon, 22 Feb 2010 22:13:09 -0300
> On a related note, is there any chance that Lua 5.2 will allow
> require() to take additional parameters that will be passed to the
> loaded chunk? That's the only reason I really need to use loadfile(),
> to pass my own parameters. require() already passes the module name
If write your Lua module like this:
return function (...)
...
end
Then you can require this module as
require("mymodule")(100,200,300)
If all your modules are like that, then you can redefine require as:
do
local old_require=require
function require(name,...) return old_require(name)(...) end
end