[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: There's gotta be a more "Lua" way to do this
- From: "Ashwin Hirschi" <deery@...>
- Date: Thu, 3 Jul 2003 04:56:20 +0200
> What's the more "Lua" way to generically create a closure for a given
> function and its arbitrary arg list than the following:
[snip<]
How about something like:
function closure(func, ...)
return function() call(func, arg) end
end
for Lua 4, or:
function closure(func, ...)
return function func(unpack(arg)) end
end
for Lua 5?
Is that what you're after?
Ashwin.