lua-users home
lua-l archive

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


I'm working with Lua scripts driving C code and trying to write a wrapper around functions like so

function doit()
  local status, err = pcall(unpack(arg))
  -- do something with status and err
end

and

doit(x, arg1, arg2, ...)

Now the problem is arg1, arg2 etc can genuinely be nil, and unpack stops at nil. Is there any way I can get unpack to get all the entries in the table, whether or not they are nil? Thanks,
saurabh



With Windows Live, you can organize, edit, and share your photos.