lua-users home
lua-l archive

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


2013/7/1 Tim Hill <drtimhill@gmail.com>:

> My feeling was that simply adding a standard way to do this avoided both of
> these work-arounds.

Inspired by all this, I wrote a module called 'empty'.

$ lua -l empty
Lua 5.2.2  Copyright (C) 1994-2013 Lua.org, PUC-Rio
> x={1,2,empty,empty,5}
> =x[3]
empty
> type(x[3])
> =type(x[3])
empty

I'm not telling anybody how it works. Maybe it invokes a totally different
interpreter that fakes the official appearance. Maybe it's pure Lua.
Maybe it's a C module.

What, apart from the fact that you need to require it, makes it fall
short of what is desired? Only the fact that the official Lua does
not have it and does not document it?