I am trying to use this function in Lua 4:
function ternary(cond, T, F)
if cond then return T else return F end
end
In this context:
loadHW1 = false
print(ternary(loadHW1 == true, "this should not appear", nil))
However, the text always gets printed when instead I expect the result to be nil. What am I doing wrong? Thanks.
[ed]
I switched to this but still get a "this is true" result:
loadHW1 = 0
print(ternary(loadHW1, "this is true", "this is false"))