lua-users home
lua-l archive

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


> While you're in such a forthcoming mood: what will happen in
> the following cases?
>     t={1,2,3}; table.insert(t,-1e8,nil); print(t[1])
>     t={1,2,3}; k=-42; table.insert(t,k,1); table.remove(t,k); print(t[1])


roberto@arraial:~/prj/lua$ lua
Lua 5.2.0  Copyright (C) 1994-2011 Lua.org, PUC-Rio
>  t={1,2,3}; table.insert(t,-1e8,nil); print(t[1])
nil
> t={1,2,3}; k=-42; table.insert(t,k,1); table.remove(t,k); print(t[1])
nil


-- Roberto