lua-users home
lua-l archive

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


On Tue, 5 Jun 2018, 07:27 nobody, <nobody+lua-list@afra-berlin.de> wrote:
On 2018-06-02 19:46, Andrew Gierth wrote:
>>>>>> "Rodrigo" == Rodrigo Azevedo <rodrigoams@gmail.com> writes:
>
>   Rodrigo> NIL_IN_TABLE is good only for 'arrays' types,
>
> This is absolutely not true; I've been finding the lack of nils in
> tables _very_ frustrating, and none of my use-cases have been anything
> to do with arrays as opposed to more general tables.

Can you (abstractly, briefly) describe a few of them?

(For me, `nil` is a _symbol_ for "there's nothing here", so the approach
of actually storing nils seems backwards… and so I'm looking for other
solutions.  Having a bunch of test problems would be handy.  I scanned
through the relevant threads I recalled and didn't find any good ones.)

Regards,
nobody


I like to think that t={} creates a table with every possible numeric, string, boolean etc key value pre-filled with nils. pairs() just ignores nil values.

Vaughan