[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: __tostring and string.format
- From: Arseny Vakhrushev <arseny.vakhrushev@...>
- Date: Wed, 8 Dec 2010 12:47:11 +0300
> 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