lua-users home
lua-l archive

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


paul@thev.net wrote:
> 
> >From the manual, I see a function can take indefinite number of
> arguments by taking them from a table. But how about the reverse?
> 
> function foo(a, b, c)
>     print(a, b, c)
> end
> 
> Doing foo(1, 2, 3) works perfectly, but
> 
> x = { 1, 2, 3 }
> foo(x)
> 
> is an obvious error. How do I pass a flattened table as function
> arguments? 

Try
  call(foo,x)

Regards,
Renato