lua-users home
lua-l archive

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


> What I tend to do is following:
> 
> function f(...)
>  local args = { n=select('#', ...), ... }
>  -- do something with args
>  return unpack(args, 1, args.n)
> end
> 

Exactly! But it seems you do not have to have a separate 'n' field in plain Lua because unpack works well with {...}-constructed tables. For some reason, this behavior is different in LuaJIT.

// Seny