lua-users home
lua-l archive

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


On Wed, Jun 10, 2009 at 1:59 PM, Luiz Henrique de
Figueiredo<lhf@tecgraf.puc-rio.br> >   > setmetatable(t,{
>            __call = function (x,y,z) return next(x,z) end
>    })
>
>    for k,v in t do print(k,v) end
>
> No parentheses needed.

That is actually rather cute, but how would you do that for an
ipairs-style iterator?

steve d.