2.2 - Booleans
The boolean type has two values,
false and true,
which represent the traditional boolean values.
However, they do not hold a monopoly of condition values:
In Lua, any value may represent a condition.
Conditionals (such as the ones in control structures)
consider false and nil as false
and anything else as true.
Beware that, unlike some other scripting languages,
Lua considers
both zero and the empty string as true in conditional tests.
Copyright © 2003-2004 Roberto Ierusalimschy. All rights reserved.
|
|
 |