[Date Prev][Date Next][Thread Prev][Thread Next]
- 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
-- g: function with ai fixed
function curry (f, ...)
local fix = arg
return function (...)
return f (unpack (fix), unpack (arg))
which is a lot simpler than messing around with C.
http://www.mupsych.org/~rrt/ | Caution Children At Play Drive Slowly (Anon)