首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

lua 模拟兑现switch

2012-12-22 
lua 模拟实现switch可以考虑实现如下模式形式,也许还有跟变态的方式,在不考虑效率下可以想想,闪人睡觉swit

lua 模拟实现switch

可以考虑实现如下模式形式,

也许还有跟变态的方式,在不考虑效率下可以想想,闪人睡觉



switch(s,{
??? ca1=function()
??? end
??? ca2=function()
??? end
})
switch(s,
??? case(s,function()
??? end),
??? case(s,function()
??? end),
??? default(function()
??? end)
)

?switch(s,
??? case(s,function()
??? end),
??? case(s,function()
??? end),
??? default(function()
??? end)
)
switch(s){
???
??? sss=function()
??? end,
??? sss=function()
??? end,
}

switch(s){
???
??? sss=function()
??? end,
??? sss=function()
??? end,
}

热点排行