lua-users home
lua-l archive

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


It was thus said that the Great Paige DePol once stated:
> > On Nov 19, 2013, at 7:27 PM, Tim Hill <drtimhill@gmail.com> wrote:
> > 
> > As has been noted, I don’t think “0 == false” should be true anyway .. in current Lua “nil == false” is also false. It’s important not to confuse “false-ness” with the value “false”.
> 
> Upon further reflection, and a good night sleep, I now see what you mean,
> Tim. :)
> 
> I have made it so that boolean true/false should be false when compared to
> numbers. Numeric 0 will still result in a false value when used in
> expressions, but when compared to an actual boolean value, it will return
> false.

  Okay, so what happens here?

	function set_timeout(timeout)
	  local timeout = timeout or math.huge

	  -- rest of function
	end

	set_tiemout(0)

  Have I set the timeout to 0, or math.huge?

  -spc