lua-users home
lua-l archive

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

On 10/06/2014 20:41, Coda Highland wrote:
On Tue, Jun 10, 2014 at 3:41 PM, Thiago L. <> wrote:
My proposal is basically to change require to call the module with args.

Let's say your module looks like this:

The current require() does this:


My proposal is to make it do this:

mymod    with    args

(PS: Obviously when using require with args it should reload the module
instead of using the loaded one)
This is a very, very common request. Unfortunately, the issue of
caching the module makes it complicated.

Here's one example of a thread:

/s/ Adam

Well it could cache the main chunk somewhere...

require("mymod","with","args") => package.mains["mymod"]("mymod","with","args")