Module:Sandbox/Ahecht/expand

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search
local function expand(frame, template)
	return frame:expandTemplate{title=template, args=frame.args}
end
	
return setmetatable({}, {__index =												-- returns an empty TABLE whose metatable has the __index set so that, for any given KEY, it returns
	function(_, template)														-- this anonymous function called as function(TABLE, KEY)
		return function (frame) return expand (frame, template) end;			-- which in turn returns a function that calls expand() with the KEY name
	end
})