lua-users home
lua-l archive

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


Am 17.03.2018 um 19:03 schrieb Russell Haley:
> On Sat, Mar 17, 2018 at 10:54 AM, Stephan Hennig <sh-list@posteo.net 
> <mailto:sh-list@posteo.net>> wrote:
> 
>     Am 17.03.2018 um 18:08 schrieb Coda Highland:
>     > On Sat, Mar 17, 2018 at 11:55 AM, Stephan Hennig <sh-list@posteo.net <mailto:sh-list@posteo.net>> wrote:
>     >> Am 17.03.2018 um 17:06 schrieb Stephan Hennig:
>     >>
>     >>> I tend to think tables with nil are constant size or grow only.  So
>     >>> here's a stupid question:
>     >>>
>     >> What use-case is there to have nil in tables /and/ to be able to
>     >> delete (any) values from the same tables?>
> 
> https://github.com/RussellHaley/lua-persist
> 
> For my key-value store library I have to add true/false to
> enumerations and I have to check for nil and add false to
> uninitialized values. Not a bid deal, but nil in tables 'feels more
> natural' to me.
I'm all for tables with nils.


> If I want holes, I can force them with undef.

Asking for nil in tables naturally asks for nils /and/ holes in the same
table.  But I'm not convinced there's really a need for having both at
the same time.


> Otherwise, I can expect a sequence like behaviour, which makes me 
> happy.

Sharing your happiness!

Best regards,
Stephan Hennig