Module:Sandbox

-- This is a sandbox for testing lua scripts. -- See Extension:Scribunto for more information.

p={frame}

function p.f(frame) --   local r=p.m({'2x','@','abc','def'},frame) local t = {'2x','@','abc','def'} r='' for n,v in ipairs(t) do      r=r..'n='..n..', v='..v..', ' end local r = r..p.m({t[1],t[2],t[3],t[4],t[5],t[6]},frame)..'-'..p.m(t,frame) --   return r --end --function p.w(frame) --   local t = frame.args for n,v in ipairs(t) do      r=r..'n='..n..', v='..v..', ' end --local r = r..'\n\n'..p.m({t[1],t[2],t[3],t[4],t[5],t[6]},frame)..'-'..p.m(t,frame) return r end

function p.m(t,frame) local tplname = t[1] local delim = t[2] or nil local n   local v    local r = '' for n,v in ipairs(t) do      if n > 3 and delim then r = r .. delim end if n>2 then r = r .. frame:expandTemplate{title = tplname, args = {v}} end end return r end

return p