Module:Anchor

-- This module implements. -- This is a modified version from wikipedia:Module:Arguments.

--

local getArgs = require('Dev:Arguments').getArgs

-- [=[ Local implementation/mod of "compressSparseArray" ]=] - local function compressSparseArray(t) local ret = {}; -- because freaking metatables for _,v in pairs(t) do       if (v ~= nil) then ret[#ret + 1] = v; end; end return ret; end

-- [=[ Native program continues... ]=] --- local p = {}

function p.main(frame) -- Get the positional arguments from #invoke, remove any nil values, -- and pass them to p._main. local args = getArgs(frame) local argArray = compressSparseArray(args) return p._main(unpack(argArray)) end

function p._main(...) -- Generate the list of anchors. local anchors = {...} local ret = {} for _, anchor in ipairs(anchors) do		ret[#ret + 1] = ' ' end return table.concat(ret) end

return p