[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Arguments to require?
- From: Nevin Flanagan <Alestane@...>
- Date: Mon, 12 Jul 2010 22:07:50 -0400
On Jul 12, 2010, at 9:18 PM, David Manura wrote:
> All is not lost though. If you need side-effects unique to each
> import, you need to call some other function following `require` to
> pass your arguments to. For example,
> `require(name):import(arguments...)`.
It also occurs to me that if your module is supposed to produce a factory of some kind that needs additional arguments to be complete, it could return a factory function instead of a table:
require "name" (...)
This would probably be restricted to fairly specific uses, though. Mostly I'm just tempted by the module chunk's stack frame sitting there totally unused.
Nevin Flanagan