[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Zero as False
- From: Coda Highland <chighland@...>
- Date: Wed, 20 Nov 2013 09:08:14 -0800
On Wed, Nov 20, 2013 at 9:01 AM, Sean Conner <sean@conman.org> wrote:
> 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
>
You've set it to math.huge, but Paige already said that Lunia isn't
going to support the idiomatic use of and/or for that.
/s/ Adam
- 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
- Re: Zero as False, Sean Conner