• Welcome to the Kancolle Wiki!
  • If you have any questions regarding site content, account registration, etc., please visit the KanColle Wiki Discord

Difference between revisions of "Module:Core"

From Kancolle Wiki
Jump to navigation Jump to search
(Created page with " local Utils = {} function Utils._apply(fn, args) return fn(unpack(args)) end function Utils._method(module, mth, ...) local module = require("Module:" .. module) return ...")
 
m
Line 2: Line 2:
 
local Utils = {}
 
local Utils = {}
  
function Utils._apply(fn, args)
+
function _method(m, f, ...)
return fn(unpack(args))
+
m = require("Module:" .. m)
end
+
return m[f](m, ...)
 
 
function Utils._method(module, mth, ...)
 
local module = require("Module:" .. module)
 
return module[mth](module, ...)
 
 
end
 
end
  
 
function Utils.method(frame)
 
function Utils.method(frame)
return Utils._apply(Utils._method, frame.args)
+
return _method(unpack(frame.args))
 
end
 
end
  
 
return Utils
 
return Utils

Revision as of 18:12, 27 November 2015

Documentation for this module may be created at Module:Core/doc

local Utils = {}

function _method(m, f, ...)
	m = require("Module:" .. m)
	return m[f](m, ...)
end

function Utils.method(frame)
	return _method(unpack(frame.args))
end

return Utils