[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: Propsoal: a lua dialect without nil
- From: Julien Duminil <julien.duminil@...>
- Date: Wed, 16 Feb 2011 12:34:14 +0100
> "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)