lua-users home
lua-l archive

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


Thanks all the people. I realized the problem.
"," (and many other operators, such as "()", "[]" etc.) will truncate the variables before it.

Now I also believe a table must be created to append a value to "...".
To append a value to "..." more efficiently, low level stack operations are needed. As Peter said, a C function is a better choice.


On Tue, Nov 11, 2008 at 8:06 PM, Duncan Cross <duncan.cross@gmail.com> wrote:

On Tue, Nov 11, 2008 at 11:39 AM, Jun Wu <idearet@gmail.com> wrote:
Sorry. But I have mistyped  ...
unpack{ ... , "a" } just works :p

It doesn't. It will truncate ... to its first value (or expand it to nil if there were no varargs) just the same as if you tried to directly return ..., "a"