[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Generating a Lua function in C
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Thu, 5 Feb 2009 22:11:38 -0200
> I've had a desire to do a similar thing. [...] My examples are pretty simple:
It's hard to cater for both in the same code.
> return function()
> return ACallback(5, 10)
> end
Try
function freeze(f,a,b)
return function() return f(a,b) end
end
ACallback=print
freeze(ACallback,10,20,30)(100,200)
> function(value)
> TheCallback(value, 10)
> end
Try
function freeze(f,a)
return function (x) return f(x,a) end
end
TheCallback=print
freeze(TheCallback,10,20,30)(100,200)