is there a pass statement in Lua like in python

前端 未结 1 1860
梦谈多话
梦谈多话 2021-01-11 20:25

Like in python we are having pass statement.

def calcu():
    pass

in Lua is there any statment like this ? i want to do

if connect then 
          


        
相关标签:
1条回答
  • 2021-01-11 20:56

    pass in Python does nothing. In Lua, you can just leave it empty:

    if connect then end
    

    If you want a placeholder, use an empty block

    if connect then do end end
    

    or if in Lua 5.2, use a semicolon:

    if connect then ; end
    
    0 讨论(0)
提交回复
热议问题