lua-users home
lua-l archive

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


> On Nov 19, 2013, at 4:35 PM, Rena <hyperhacker@gmail.com> wrote:
> 
> And the == and ~= operators?

Those work as expected, which is why I think the 'and' and 'or' operators should also work properly.

Some examples:

if 0 then print("true") end			-> no output
if 1 then print("true") end			-> true

local zero, one = 0, 1
if zero then print("true") end			-> no output
if one then print("true") end			-> true

if not zero then print("true") end		-> true
if not one then print("true") end		-> no output

if zero == 0 then print("true") end		-> true
if one == 0 then print("true") end		-> no output

if zero ~= 0 then print("true") end		-> no output
if one ~= 0 then print("true") end		-> true

if 0 and 1 then print("true") end		-> no output
if 0 or 1 then print("true") end		-> true

if zero and one then print("true") end		-> no output
if zero or one then print("true") end		-> true

if not zero and not one then print("true") end	-> no output
if not zero or not one then print("true") end	-> true

Seems things are working as expected with the zero as false patch so far! :)

~pmd~