lua-users home
lua-l archive

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


> 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