lua-users home
lua-l archive

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



-----Original Message-----
From: Jim Bumgardner []
Sent: Thursday, October 02, 2003 10:47 PM
Subject: 0 ~= false


This one bit me a couple of days ago:


x = 0




if (x) then doSomethingObnoxious() end



Most of the languages I'm accustomed to would consider x to be false, which had

put me into the bad habit of occasionally using zero when I wanted false.  


Sadly, Lua doesn't consider zero to be false, so my program did something obnoxious.  :)


- Jim