Module:Sort

From MediaWiki.org
Jump to navigation Jump to search
Module documentation
local p = {}
  
function p.f(frame)
	local t = {}
	local delim = frame.args[1]
	-- This adds all arguments, including named parameters,
	-- in an unspecified order, but fields for consecutive values
	-- starting at 1 will probably be in numerical order.
	for n, v in pairs(frame.args) do table.insert(t, v) end
	table.remove(t, 1)
	table.sort(t)
	return table.concat(t, delim)
end
 
return p