lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Am 18.10.03 02:28 schröbte Bilyk, Alex:
In other words
C    --> CONDITION ? X : Y
Lua --> CONDITION and X or Y

But be careful! It doesn't work if X has a false value:

local boolvar = true
print( "(not boolvar) is:", boolvar and false or true )
boolvar = false
print( "(not boolvar) is:", boolvar and false or true )

prints "(not boolvar) is:   true" in both cases.



AB


Philipp