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:
> 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