lua-users home
lua-l archive

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


> >ipairs in work4 behaves identically to the 5.1 version. (with the
> >exception of returning nil in place of nothing)
> >
> >Is the doc wrong or the code?
> >
> >
> 
> I believe the doc is wrong, since the thinking was that since ipairs
> is being deprecated there was no reason to also change its
> functionality.

The doc is wrong, but not because of this thinking (given that it is not
being deprecated any more). The problem is that, with the possibility
of tables to redefine '#', the implementation was wrong, and a correct
implementation was somewhat expensive (checking against '#' in every
iteration).

Anyway, ipairs is back with its 5.1 semtantics.

-- Roberto