[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: Mon, 14 Sep 2009 13:12:31 -0300
> meta = {__call=function(o,i) return next(o,i) end}
> tab = {"Rio", "London", "Berlin"}
> setmetatable(tab, meta)
> for _,v in tab do print(v) end
>
> But now it prints "Rio" endlessly and the iteration does not advance. Can
> someone please show me the code to make this second case work?
meta = {__call=function(o,x,i) return next(o,i) end}