lua-users home
lua-l archive

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


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.