lua-users home
lua-l archive

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




On Mon, Mar 19, 2018, 2:38 PM Gregg Reynolds <dev@mobileink.com> wrote:


On Tue, Mar 13, 2018, 2:44 PM Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:
> btw, I notice that there is a new keyword, "undef", not mentions in manual,
> is that just a undocumented feature or the doc just not the latest?

I am grad you asked :-)

Lua 5.4 has an experimental change that is off by default (to keep
compatibility). We plan to keep this off in Lua 5.4 final.
You can turn it on by compiling this version with the option
-DLUA_NILINTABLE. As the name hints, this option allows nils in tables:

Strictly speaking, that is false, because you have changed the meaning of "nil". If you add this, then you have a new language, which is not Lua. That is, it would not be a "conservative extension" of Lua, since it would change the meaning of programs.

I think there is a better way to get what you want, though I'm not sure what it is.

Gregg