[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: NaN (was: Re: The Undefined Country (was Re: Quest: real world "Lua array with holes" usage))
- From: steve donovan <steve.j.donovan@...>
- Date: Mon, 25 Jul 2016 11:51:57 +0200
On Mon, Jul 25, 2016 at 11:44 AM, Dirk Laurie <dirk.laurie@gmail.com> wrote:
> People who use NaN in its natural sense should not be inconvenienced
> in order to pander to those who use it as a hack. In a table of memoized
> function values, nil should mean 'has not been computed' and NaN
> should mean "has been computed, and the result was NaN".
OK, I retract my +1. I forget that floating point numbers are
complicated enough without magic properties.
I still think that if Lua 5.4 provided a single unique constant null
(without any other properties) then we are fine. Saying 'if v ~= null`
is not much harder than `if v ...` and has the advantage of
explicitness. All packages would then have the same agreed sentinel
value for filling holes.
- References:
- Quest: real world "Lua array with holes" usage, Rodrigo Azevedo
- Re: Quest: real world "Lua array with holes" usage, Roberto Ierusalimschy
- Re: Quest: real world "Lua array with holes" usage, Jorge
- Re: Quest: real world "Lua array with holes" usage, Hisham
- Re: Quest: real world "Lua array with holes" usage, Roberto Ierusalimschy
- The Undefined Country (was Re: Quest: real world "Lua array with holes" usage), Sean Conner
- Re: The Undefined Country (was Re: Quest: real world "Lua array with holes" usage), nobody
- Re: The Undefined Country (was Re: Quest: real world "Lua array with holes" usage), Jonathan Goble
- NaN (was: Re: The Undefined Country (was Re: Quest: real world "Lua array with holes" usage)), Soni L.
- Re: NaN (was: Re: The Undefined Country (was Re: Quest: real world "Lua array with holes" usage)), steve donovan
- Re: NaN (was: Re: The Undefined Country (was Re: Quest: real world "Lua array with holes" usage)), Dirk Laurie