lua-users home
lua-l archive

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


On 2/25/07, Matthew A. Nicholson <matt@matt-land.com> wrote:
Greetings,

Luaxx is a thin wrapper around the Lua C API.  The wrapper adds some
convience functions and intergrates well with modern C++.  This is a
header only library and has no runtime dependencies besides Lua itself.
  Luaxx is pretty much just a straight translation of the C api into C++
and does not really add any new functionality.  It also does not attempt
to do toLua style integrations.  Every function included is documented
but most of the standard Lua C api documentation applies.

I wrote this code, because I could not find anything similar and up to
date with Lua 5.1.  This is the initial release, and it does everything
that I have needed it to do, but the library is by no means complete (it
does not wrap all of the API functions, just the ones that I use :).
Patches and comments are welcome.

You can download it from my website http://matt-land.com/luaxx (for
now).  If you use Debian Linux, you can build a deb from the sources
using dpkg-buildpackage.  A pkg-config file is also included (luaxx.pc).

Great job on the library, however I think it could use a little fixing
for the 'as' function.  Passing in a variable of the type in order to
get C++ to know what type to use doesn't sound like the best idea.
Using C++ templates seems to make the most sense to me.

Instead of:
int val = L.as(0, index);
It would be:
int val = L.as<int>(index);

... Just my 2 cents.
--
Thomas Harning Jr.