lua-users home
lua-l archive

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




On Tue, May 31, 2016 at 10:19 AM, Javier Guerra Giraldez <javier@guerrag.com> wrote:
On 31 May 2016 at 05:42, Justin Donaldson <jdonaldson@gmail.com> wrote:
> it needs to track its length in order to accommodate nil values


The usual approach to store nil values in a table is to use your own
'pseudo nil' value.

Consider creating an array [1,2,3], and then setting the index 100 to 4.  The indexes 4-99 will still be nil.   The length of that array reported by maxn/# would still be indeterminate.  How do I resolve that?