lua-users home
lua-l archive

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


On 12/09/2011, at 10:51 AM, Peter Pimley wrote:

> Dear Lua list,
...
> The best I can come up with is to use an anonymous "converter"
> function, something like:
> 
> f = {
>  func = function(p) foo (p[1], p[2]) end,
>  params = {23, 42}
> }

Doesn't unpack do what you want?

$ lua 
Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio
> function a(b, c)
>> print(b, c)
>> end
> a(unpack{1,2})
1	2