Intestazione: Modulo:Sandbox/Ignazio Cannata/man


require('Module:No globals')
local p = {}

function p.ciao( frame )
    return 'Ciao, mondo!'
end

function p.ciao_nome1( frame )
    return "Ciao, " .. frame.args[1] .. ", " .. frame.args[2] .. "?"
end

function p.ciao_nome1b( frame )
    local args = frame:getParent().args
    if args[1] and args[2] then
    return 'Ciao, ' .. args[1] .. ', ' .. args[2] .. '?'
    elseif args[1] and not args[2] then
    return "Ciao, " .. args[1] .. "!"
    end
end

function p.ciao_nome2( frame )
    return "Ciao, " .. frame.args["nome"] .. ", " .. frame.args["saluto"] .. "?"
end

function p.ciao_nome2b( frame )
    return "Ciao, " .. frame.args.nome .. ", " .. frame.args.saluto .. "?"
end

return p