lua-users home
lua-l archive

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


Sorry if this suggestion has already been made but the thread is getting long.

Wouldn't the easiest solution be for #t just to return largest integer index of the table? Ipairs would just continue working as before. The problem of holes would be solved, they are legal in the table.

Robert

----- Original Message -----
> From: "Javier Guerra Giraldez" <javier@guerrag.com>
> To: "Lua mailing list" <lua-l@lists.lua.org>
> Sent: Friday, 4 October, 2013 4:24:42 PM
> Subject: Re: pairs(t, skey) and ipairs(t, skey)
> 
> On Fri, Oct 4, 2013 at 9:21 AM, Schmidt, Phil <PSchmidt@watlow.com> wrote:
> >> a[3]=nil
> 
> 
> there you're creating a hole, so it's no longer a sequence, and the
> statement isn't aplicable.
> 
> "a sequence has no holes" means: "if it has holes, it's not a sequence"
> 
> --
> Javier
> 
>