Module:Sandbox

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

p={}

function p.f(frame) r=5 p.g r=r..p.foreach({'2x','@','abc'}) return r end function p.g r=r+1 end

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

return p