Jump to content

Module:Sandbox/Wnt

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Wnt (talk | contribs) at 00:23, 13 June 2014 (Duh, there's no actual reason to return a function from within the table p. So I can leave p totally empty and put my functions in other structures as I see fit, and no chance of collision.). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
local p = {}
local q = {}

function q.main (action, args)
	return "action = " .. (action or 'NIL') .. "args[1] = " .. (args[1] or 'NIL')
end
 
setmetatable(p, { __index = function(t, k)
	return function(frame)
	    return q.main (k, frame.args)
	end
end })
 
return p