lua-users home
lua-l archive

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


 

http://lua-users.org/wiki/ExpressionsTutorial

 

http://lua-users.org/wiki/TutorialDirectory

 

 

-----Original Message-----
From: Jim Bumgardner [mailto:jbum@jbum.com]
Sent: Thursday, October 02, 2003 10:47 PM
To: lua@bazar2.conectiva.com.br
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