📜  lua 开关 - Lua 代码示例

📅  最后修改于: 2022-03-11 14:54:55.847000             🧑  作者: Mango

代码示例1
function switch(caselist, case)
    assert(type(caselist), "Not a table")
    if(caselist[case])then
        assert(type(caselist[case]), "Not a function")
        caselist[case]()
    end
end