lua-users home
lua-l archive

Re: Multiple assignment, numeric table keys

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


On Wednesday, December 12, 2012 06:16:21 AM Kevin Martin wrote:
> Example 2:
> > t = {}
> > t[#t+1], t[#t+2] = 1, 2
> > for k,v in pairs(t) do print(k,v) end
> 
> 1	1
> 2	2
This makes me wish that table.insert accepted multiple values.
 table.insert(t, 1, 1, 2)
-- 
tom <telliamed@whoopdedo.org>

AltStyle によって変換されたページ (->オリジナル) /