[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [Bug report] unpack()ing multiple tables does not behave as expected
- From: Petite Abeille <petite_abeille@...>
- Date: Fri, 16 May 2008 19:30:34 +0200
On May 16, 2008, at 5:59 AM, ddneilson wrote:
Hm, so it is. It's such an odd behaviour (read: counter intuitive to
me) that I honestly didn't think for a second that it was actually
intentional! <shrug>
Oh, well... roll your own then... e.g.:
function unpacks( ... )
local someValues = {}
for anIndex = 1, select( '#', ... ) do
for _, aValue in ipairs( select( anIndex, ... ) ) do
someValues[ #someValues + 1] = aValue
end
end
return unpack( someValues )
end
print( unpacks( x, y ) )