lua-users home
lua-l archive

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


On Sat, 22 May 2010, Duck wrote:

> Please help a nonexpert here...
> 
> Without ipairs(), how do I code this convenient (and clear) idiom:
> 
> --
> 
> for _,v in ipairs{'lumpi','ist','mein',hund'} do
>    print(v)
> end

Using pairs().

for _,v in pairs{'lumpi','ist','mein',hund'} do
   print(v)
end