lua-users home
lua-l archive

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


Hi

As I understand it, nil used to mean “doesn’t exist insofar as your program logic is concerned”
If I did (roughly)
  t[1]=nil
  Print(#t)
I’d get 0

With 5.4 (if he option is enabled) the output would be 1

So nil would now mean “might exist, has no value, and your program logic might have to be aware of this”
And undef means “does not exist insofar as your program is concerned”

It seems to me that changing nil and adding something new to replace nil is backwards because it can break existing programs.
It would be better to have nil have the same semantics in 5.4 and undef have the new semantics.

This preserves backwards compatibility and makes it easier for deployed systems to upgrade

Frank Kastenholz