lua-users home
lua-l archive

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

Hi Phill,

>> next(t, #t) returns the first key in the hash part (if any).
> This isn't necessarily true. It is possible to set up a table with
> multiple holes in the array part such that next( t, #t ) will return
> an index which still falls in the array.

I wasn't careful in my phrasing of that sentence. Yes, it may return a
key that follows one of the holes, but this is exactly what I'd
need/expect in this case.

For example, using this table, {"a", nil, nil, "f", "g", [7] = {}, [9]
= "i"}, #t gives me 5 (Lua 5.1) and next(t, #t) returns 7.