lua-users home
lua-l archive

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


On Wed, Feb 16, 2011 at 9:51 AM, Axel Kittenberger <axkibe@gmail.com> wrote:
> In a nil-less world, this would be a very uncommon operation anyway.

But I cannot see what must happen in this common case:

local a,b

Variables must have a value; what shall it be if not nil?

I.e. it is hard to banish the need for nil, if we insist that all
variables must have a definite value. So something like nil always
sneaks in. And insisting on always initializing locals would be
irritating.

Something that has been floated before, of course, is that there
should be two kinds of nil; call them nil and null (they both have
type 'nil' and both evaluate as false); the difference is that null
can be put into a table. I think Mark Hamburg suggested something like
this in the last 'holes, dammit!' discussion, but it was felt that
this was a foreign idea imported from JavaScript. (His suggestion was
something a bit more subtle; that this null value would not
necessarily be visible to the programmer, but exist as a
non-nil-but-nil-like value to put into tables)

steve d.