lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Tue, 16 Jun 2009 04:09:07 +0300, David Manura <dm.lua@math2.org> wrote:

I too came across this omission when writing lua2c [1], 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
[1].  I would prefer if Lua defined these functions itself, as that
would remove boilerplate from the lua2c output.

  [1] http://lua-users.org/wiki/LuaToCee

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.