[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: callback implementation details..
- From: Reuben Thomas <rrt@...>
- Date: Sat, 18 Oct 2003 01:01:54 +0200 (CEST)
> Did you try this code? I think it is what you might be looking for,
> actually. Although you can do it with unpack() etc.
Yes, curry is simply:
-- curry: Partially apply a function
-- f: function to apply partially
-- a1 ... an: arguments to fix
-- returns
-- g: function with ai fixed
function curry (f, ...)
local fix = arg
return function (...)
return f (unpack (fix), unpack (arg))
end
end
which is a lot simpler than messing around with C.
--
http://www.mupsych.org/~rrt/ | Caution Children At Play Drive Slowly (Anon)