Module:Sandbox/Ahecht/expand
< Module:Sandbox | Ahecht
File:Test Template Info-Icon - Version (2).svg Module documentation[create] [purge]
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
})