lua-users home
lua-l archive

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


> 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.