lua-users home
lua-l archive

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


On Sun, Jan 09, 2011 at 12:04:16PM +0200, steve donovan wrote:
> If the task being nil is important, then the 'sentinel' pattern is useful.
> 
> local null = {}
> ....
> table.insert(t,v or null)
> 
> No holes!
And it prints nicely if you do this:

setmetatable(null,{__tostring = function() return 'null' end})

Dirk