x = x or v. 等价于. if not x then. x = v. end. and 的优先级比or 高。 C 语言中的三元运算符 a ? b : c. 在Lua 中可以这样实现: (a and b) or c.
確定! 回上一頁