util/import.lua@e7c1e30d06d5
util/import.lua
Fri, 21 Nov 2008 05:59:03 +0000
- author
- Matthew Wild <mwild1@gmail.com>
- date
- Fri, 21 Nov 2008 05:59:03 +0000
- changeset 372
- e7c1e30d06d5
- parent 49
-
1cd2a8db392d
- child 519
-
cccd610a0ef9
- permissions
- -rw-r--r--
Now possible to specify nil origin to core_route_stanza. Origin will be chosen as the host of the 'from' attribute on the stanza. Returns false on no such host.
local t_insert = table.insert;
function import(module, ...)
local m = package.loaded[module] or require(module);
if type(m) == "table" and ... then
local ret = {};
for _, f in ipairs{...} do
t_insert(ret, m[f]);
end
return unpack(ret);
end
return m;
end