This bit of code is confusing me.
print(gogo)
if (gogo == true) then
print("yes")
elseif (gogo == false) then
print("no")
end
Why is gogo
evaluating as true
? Shouldn't it spawn an error instead?
It doesn't evaluate to true and it can't because there is no boolean type in Lua 4.0.
print(true) -- prints "nil"
Undefined global variables are nil
by default, so indeed gogo == true
. They are both nil
.