[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:05:22 +0300
>> Actually, it works well. I mean {...}/unpack() is fully reversible.
>
> You're just lucky with your data
>
> $ lua -e 'print(select("#", unpack{ 1, nil, 3 }))'
> 3
>
> $ luajit2 -e 'print(select("#", unpack{ 1, nil, 3 }))'
> 1
>
Well, I was talking about vanilla Lua. Anyway, the above difference is very weird because it doesn't allow to postpone the usage of varargs, for instance, in some coroutine create/resume loop where arguments could be anything generic. Fortunately, I rely on this behavior only within a testing framework which is run under plain Lua.
// Seny