lua-users home
lua-l archive

Re: unpack

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


On Jun 21, 2007, at 18:41, Robert Ward wrote:
print(unpack(x), unpack(y))
Ah, yes... try unpacks!
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 ) )

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