Module:Other uses/sandbox explained

local mHatnote = require('Module:Hatnote')local mHatlist = require('Module:Hatnote list')local mArguments --initialize lazilylocal mTableTools --initialize lazilylocal libraryUtil = require('libraryUtil')local checkType = libraryUtil.checkTypelocal p =

-- Produces standard implementationfunction p.otheruses(frame) mArguments = require('Module:Arguments') mTableTools = require('Module:TableTools') local args = mTableTools.compressSparseArray(mArguments.getArgs(frame)) local title = mw.title.getCurrentTitle.prefixedText return p._otheruses(args,)end

--Implements "other [x]" templates with otherText supplied at invocationfunction p.otherX(frame) mArguments = require('Module:Arguments') mTableTools = require('Module:TableTools') local x = frame.args[1] local args = mTableTools.compressSparseArray(mArguments.getArgs(frame,) ) local options = return p._otheruses(args, options)end

-- Main generatorfunction p._otheruses(args, options) --Type-checks and defaults checkType('_otheruses', 1, args, 'table', true) args = args or checkType('_otheruses', 2, options, 'table') if not (options.defaultPage or options.title) then error('No default title data provided in "_otheruses" options table', 2) end local emptyArgs = true for k, v in pairs(args) do if type(k)

'number' then emptyArgs = false break end end if emptyArgs then args = end local categories = if not mw.title.new(args[2]).exists then categories = '' end --Generate and return hatnote local text = mHatlist.forSeeTableToString return mHatnote._hatnote(text .. categories)end

return p