lua-users home
lua-l archive

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


On Jul 3, 2013, at 1:55 PM, steve donovan <steve.j.donovan@gmail.com> wrote:

> On Wed, Jul 3, 2013 at 1:51 PM, Roberto Ierusalimschy <
> roberto@inf.puc-rio.br> wrote:
> 
>> I think it does: it is called 'nil'. What Lua does not have is a way to
>> store 'nil' in a table.
>> 
> 
> Very true ;)  It's all about the inability to store it…

Then make it so if that's really so disturbing to some dispositions.

(1) Keep the current semantics

t[ k ] = v -- remove 'k' if 'v' happen to be nil, otherwise set it

(2) Add some weird diacritical marks somewhere to signify "store it, I really mean it, and yes, even if it's nil, dammit"

t[ k ] = v! -- set 'k' no matter what 'v' is

Now there is no more 'holes', and all is good and peaceful in the universe. Or something.