util/import.lua

Wed, 08 Oct 2008 19:17:14 +0300

author
Paul-Sebastian Manole <brokenthorn@gmail.com>
date
Wed, 08 Oct 2008 19:17:14 +0300
changeset 75
338e75cba18d
parent 49
1cd2a8db392d
child 519
cccd610a0ef9
permissions
-rw-r--r--

Added script to pull from master mercurial repository
Added a few name suggestions to doc/names.txt
Minor edits.


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

mercurial