lua-users home
lua-l archive

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


On Mon, Feb 12, 2001 at 02:24:20PM -0800, Pete Gardner wrote:
> 
> In what ways is this better/different than tolua?
> 

I'll try and answer how it's different...

- tolua will bind _everything_ in a package file to Lua, my template class 
doesn't, so its less feature rich than tolua. It only binds those
member functions that you specify, tolua can bind any primitive or
user-defined types.

- my template class is probably easier to use than tolua, but that's only a
result that it's simple. It's also alot smaller than tolua and doesn't
require you to run an external build tool(tolua) to build the binding code.

My intentions were to build a system that would allow you to register class 
member functions as easily as possible to Lua. Member functions that return
an int and take a lua_State*, similar to the rules laid out for C functions
registered to Lua. Thus, it turned out that it came to be similar to the
functionality that tolua provides.

If you have existing classes that you would like to enable in Lua, then tolua 
is the right tool. If you're just starting to code your class and would also
like to enable it in Lua, then this template class may be of help.

Thanks,
-Lenny.