lua-users home
lua-l archive

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


> On Nov 20, 2013, at 11:01 AM, Sean Conner <sean@conman.org> wrote:
> 
>  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

timeout would be math.huge, which with numeric 0 being false for and/or statements is to be expected. ;)

I understand that in Lua timeout would be '0', but Lunia is no longer Lua, it is a second cousin at this point!

~pmd~