lua-users home
lua-l archive

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


> On Tue, May 18, 2010 at 8:12 PM, Petite Abeille
> <petite.abeille@gmail.com> wrote:
> > Hmmm... ipairs? deprecated? ouch.
> 
> Wow, yeah. Pretty bold. I notice that the readme still refers to it:
> "ipairs now goes until #t" (i.e. respecting __len metamethods) - and
> that change (as far as I understand it) must have meant either
> changing what ipairs returns into a closure, or else calculating #t
> every iteration - both of which would have been a bit costlier than
> what the old one did.

Not really. It only needs to calculate #t when the value is nil.


> So I can see why it would have been recommended to move to using
> numeric loop instead.

The point is that it does exactly the same that a numeric loop, so
there was no point in keeping it.

-- Roberto