[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Zero as False
- From: Sean Conner <sean@...>
- Date: Wed, 20 Nov 2013 12:01:48 -0500
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
- References:
- Re: Zero as False, Paige DePol
- Re: Zero as False, Daurnimator
- Re: Zero as False, Rena
- Re: Zero as False, Paige DePol
- Re: Zero as False, Coda Highland
- Re: Zero as False, Paige DePol
- Re: Zero as False, Coda Highland
- Re: Zero as False, Paige DePol
- Re: Zero as False, Tim Hill
- Re: Zero as False, Paige DePol