Module:User:Benwing2/test-append

local export = {}

local libraryUtil = require('libraryUtil') local checkType = libraryUtil.checkType

--[[

-- append -- -- This appends any number of tables together and returns the result. Compare the Lisp -- expression (append list1 list2 ...).

--]] function export.append(...) local ret = {} for i=1,select('#', ...) do		local argt = select(i, ...) checkType('append', i, argt, 'table') for _, v in ipairs(argt) do			table.insert(ret, v)		end end return ret end

function export.appendString(frame) local args = {} local i = 1 while true do		local val = frame.args[i] if not val then break end table.insert(args, mw.text.split(val, ",")) i = i + 1 end return table.concat(export.append(unpack(args)), "|") end

return export