lua-users home
lua-l archive

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


Mark Hamburg wrote:
function pack( ... )
    local result = { ... }
    result.n = select( '#', ... )
    return result
end

unpack( t, 1, t.n )


I think that is the safest way.

function pack(...)
   return {n=select('#",...),...)
end

Adrian