连接符
print(1 .. 2)--number need add space
print("a".."b")
print("abc".."123")
12
ab
abc123
print("1"<"2")
print("1"<"0")
--print("1"<0)--error:can't compare number with string
--a and b -- 如果 a 为 false,则返回 a,否则返回 b
--a or b -- 如果 a 为 true,则返回 a,否则返回 b
print("2" and "1")
print("2" or "1")
--如果 x 为 false 或者 nil 则给 x 赋初始值 v
a = a or 1
print("a="..a)
--not
print("\nnot operator")
print(not 1)
print(not 0)
print(not nil)
print(not false)
print(not not nil)
--除了^和..外所有的二元运算符都是左连接的
print("\n^ operator")
print(2^3)--2的3次方
c = nil
d = false
print(c or d)
print(c and d)
print(not c)
false
nil
true