[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Regarding the name 'pairs'
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Wed, 9 Sep 2009 08:02:43 -0300
> I would prefer a single __iter metamethod with deeper language integration
> so we can write:
>
> for v in myobject do print(v) end
You can do that already:
http://lua-users.org/lists/lua-l/2009-06/msg00221.html
> for v in myobject:myiterator do print(v) end
This is a syntax error. These would work:
for v in myobject:myiterator() do print(v) end
for v in myobject.myiterator do print(v) end