[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: '__iter', yet again!
- From: "John Hind" <john.hind@...>
- Date: Thu, 17 Dec 2009 10:01:07 -0000
This is true, but pedantic (I think). The first value in the triple has to
be a function (more precisely, callable) otherwise an error is raised (at
present). Admittedly at present the non-callability error is detected on the
first attempted iteration of the loop. This would have to be changed to test
during loop setup so the metamethod could be triggered. However I do not see
any significant problem with this change.
> -----Original Message-----
> From: lua-bounces@bazar2.conectiva.com.br [mailto:lua-
> bounces@bazar2.conectiva.com.br] On Behalf Of Mark Hamburg
> Sent: 16 December 2009 22:41
> To: Lua list
> Subject: Re: '__iter', yet again!
>
> That, however, is a semantic change. The generic for doesn't take
> collections. It takes an iterator triple. Note in particular that for
> doesn't take pairs. pairs takes a table and returns an iterator triple
> for the table.
>
> Mark
- References:
- Re: '__iter', yet again!, Jerome Vuarand
- Re: '__iter', yet again!, Luiz Henrique de Figueiredo
- Re: '__iter', yet again!, steve donovan
- Re: '__iter', yet again!, Javier Guerra
- Re: '__iter', yet again!, Mark Hamburg
- Re: '__iter', yet again!, Cosmin Apreutesei
- Re: '__iter', yet again!, Petite Abeille
- Re: '__iter', yet again!, Cosmin Apreutesei
- Re: '__iter', yet again!, Petite Abeille
- Re: '__iter', yet again!, Mark Hamburg
- RE: '__iter', yet again!, John Hind
- Re: '__iter', yet again!, Mark Hamburg