lua-users home
lua-l archive

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


Hi Tim,

> Do you *really* mean "keys in the hash part" or do you mean "non-numeric keys",
> because the two are not necessarily the same (and I don't mean just negative numeric keys).

Any key other than 1..#t. I was initially thinking about just array
and hash parts, but was reminded about holes, which should still be
handled by this logic.

Paul.

On Mon, Sep 30, 2013 at 8:07 PM, Tim Hill <drtimhill@gmail.com> wrote:
>
> On Sep 30, 2013, at 3:51 PM, Paul K <paulclinger@yahoo.com> wrote:
>
>> Hi All,
>>
>> I was looking for a way to find if there are any keys in the hash part
>> of a table without iterating the table and realized that I can use
>> "next" to give me the answer as it accepts a starting key:
>>
>> next(t, #t) returns the first key in the hash part (if any).
>
> Do you *really* mean "keys in the hash part" or do you mean "non-numeric keys", because the two are not necessarily the same (and I don't mean just negative numeric keys).
>
> --Tim
>
>
>