lua-users home
lua-l archive

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


On Tue, Mar 19, 2013 at 5:49 PM, Petite Abeille
<petite.abeille@gmail.com> wrote:
>
> On Mar 20, 2013, at 1:00 AM, Ivo Beltchev <ivo@ibeltchev.com> wrote:
>
>> because there is no way to distinguish between "not defined" and "defined, but currently nil":
>
> Sure you can. Keep track of your key assignments with __newindex and call it a day. Tables are building blocks. Feel free to build something with them.
>
>

Alternatively, define a global "null = {}" since tables only have
reference equality (that is, assert(null ~= {}) in this case) and use
that when you want to explicitly say "defined but valueless."

/s/ Adam