[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: Mon, 2 Feb 2009 15:08:21 -0200
> Hi! I was hoping an expert in the internals of Lua would help me get started
> on a new project. Basically I want to add an extra feature to the Lua API
> which generates a Lua function and returns it on the stack.
Despite the example of luac.c, you'll be much better of writing this in Lua.
Something like this:
function engram(f)
return function (x) return f(x) end
end
(If this is a correct rendition of your C code, then it all seems pointless
because engram(f) behaves just as f, doesn't it?)