News for hackers. Stuff that matters.
Re:Lua: Good, bad, and ugly parts by Fargren on Saturday March 09, 2013 @02:53PM (#5349403)
Correct me if I'm wrong, but what's inconsistent there is not boolean evaluation, it's number to boolean conversion. 1 == true and 0 == false are pretty standard, but that doesn't mean 0 and 1 are booleans.
Re:Lua: Good, bad, and ugly parts by vor_ on Saturday March 09, 2013 @03:11PM (#5349472)
Only nil and false evaluate to false. Because there's no distinction between nil and non-existent elements, checking the existence of an element with a value of 0 requires that 0 evaluates to true, so you get this situation:

  while 0 do print("loops forever") end
  while not 0 do print("does nothing") end
Re:Lua: Good, bad, and ugly parts by spicyj on Saturday March 09, 2013 @05:16PM (#5349814)
What you're saying is just that in Lua, 0 is truthy. Ruby is the same way, not a big deal.