lua-users home
lua-l archive

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

> "storing" it in a table makes the key go away an
> not show up on i/pairs

> First class nils would be able to returned by iterators that not mark
> the end of iterator.

It's just the i/pairs definition to iterate over non-nil values.

> nor can you differ if a table key "stores" a
> nil, or is not present

By default, every table key stores a nil *value* (as Luiz said, a *nothing* value).
Definition of *not present* is *equals nothing* in Lua, so stored as nil value or is not present is the same test.
(It's like you're testing *true* and *not false*, it's the same)