lua-users home
lua-l archive

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


On Sat, Dec 5, 2020 at 2:31 PM Egor Skriptunoff
<egor.skriptunoff@gmail.com> wrote:

> Conclusion:
> We need something like table.rebuild()/table.new() in Lua to avoid inserting fake values.

Would you have reached the same conclusion if the problem had been
formulated in terms of true and false rather than 'Lua' and nil?

The nil value is a special case in Lua's tables. Whether it is good
that nil is a special case is very much debatable, but this cannot be
changed without hefty consequences for compatibility. As long as nil
stays a special case, any contrived example that exposes that nil is a
special case is redundant, and any conclusions derived from such
examples are not well founded and probably futile.

Cheers,
V.