lua-users home
lua-l archive

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



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 ) )