lua-users home
lua-l archive

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


Some people mentioned that they would like that tolua accepted any valid
header file as an input, while many other said that they were not using
tolua, because they preferred their handtuned bindings.

I'm not really interested in full C/C++ compliance. Lua is very different
from C++, and you don't usually want to translate class interfaces directly,
but to change them in order to fit better in the lua programming style. For
example, while in C++ you have a protected variable with two methods to
access it (accessor/mutator) in lua you would like to access the name of the
var directly and let the binding code map the reads to the accessor and the
writes to the mutator.

Another example is the use of prefixes, many libraries have a prefix for all
of its functions and classes (SDL_, wx, etc). In lua you may probably put
them in a module, but doing this in tolua would result in redundant function
names:

SDL.SDL_Open
wx.wxApp

While you can rename the functions, you cannot do so with classes (why?),
and doing it manually is sometimes a long task.

Those little things is what keeps me away from lua. toLua should be more
flexible, and instead of just translating C++ to lua, it should allow you to
say: "this is what I want in lua, and this is what I have in C++, now
generate the binding code". But maybe that's just not possible and I'm just
dreaming awake.



Ignacio Castaño
castanyo@yahoo.es


_______________________________________________________________
Yahoo! Messenger
Nueva versión: Webcam, voz, y mucho más ¡Gratis! 
Descárgalo ya desde http://messenger.yahoo.es