lua-users home
lua-l archive

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

On Jul 6, 2013, at 9:57 PM, Andrew Starks <> wrote:

So here we can see a bunch of cases where `nil` is absolutely "a
thing" that is separate from "not ever having been defined." And I
think that's great, and at the proper level of abstraction, I can see
how it might be irrelevant.

But they still are not equivalent, not matter how hard you squint your
eyes. They're not even equivalent in daily life, even for normal

Indeed, which is why nil is perfectly acceptable as a *value* in an argument list or return value. In Lua, nil is a value, which triggers certain special behaviors on assignment to tables. It's SUPPOSED to be that way; in the C API I can push nil not he stack, I can check to see if a stack slot "contains" nil, and I can copy a nil from one part of the stack to another. Looks like a value to me.

I'm reminded of the medieval arguments about zero (a fascinating topic btw), when many people got really really worked up over the idea of a "number zero" .. how could a number, which was supposed to be a count of something, mean nothing and not be nothing itself? :)