[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Expanding an array out into a parameter list
- From: Geoff Leyland <geoff_leyland@...>
- Date: Mon, 12 Sep 2011 10:55:36 +1200
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