effectivelua

短路求值

1
2
--初始化方法
x=x or v -- if not x then x = v end
1
2
--三目运算
a and b or c -- 重要前提是b不是false,也不是nil, 否则a是true, 也是返回c
好饿好饿好饿 我真的好饿