[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Calling Lua operatiors from C
- From: "Juris Kalnins" <juris@...>
- Date: Tue, 16 Jun 2009 08:42:55 +0300
On Tue, 16 Jun 2009 04:09:07 +0300, David Manura <firstname.lastname@example.org> wrote:
I too came across this omission when writing lua2c , which
translates Lua source to C code consisting of Lua C API calls. The
workaround I ended up doing was to code generate the equivalent
functions if the operations occurred in the Lua code. For example,
look at the output for bisect.c (based on bisect.lua) on the web page
. I would prefer if Lua defined these functions itself, as that
would remove boilerplate from the lua2c output.
The code templates used are copied at the bottom of this message.
Many thanks! This is very clean and fast, compared to
calling Lua functions that implement each operator.