[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Re: Tables of Functions
- From: Sam Roberts <sroberts@...>
- Date: Mon, 25 Sep 2006 17:16:15 -0700
On Mon, Sep 25, 2006 at 04:58:59PM -0700, Ken Smith wrote:
> Right. Ok. I can use the non-syntactic sugar version to create my
> list of functions. Thank you for the responses.
You may know, but if defining functions in order ([1], [2], ...) you also can do:
vtable = {
function (x)
print(x)
end,
function (y)
print(y*2)
end,
-- ...
}
t[2](5)