lua-users home
lua-l archive

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


On Thursday, March 05, 2015 08:53:03 AM Dirk Laurie wrote:
> Lua 5.3.0  Copyright (C) 1994-2015 Lua.org, PUC-Rio
> 
> > a={1}
> > for k,v in ipairs(a) do
> 
>    a[k+1]=k+1
>    print(a[k])
>    if k==5 then break end
> end

Which also "accidentally" works if you use pairs instead.

-- 
tom <telliamed@whoopdedo.org>