lua-users home
lua-l archive

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


Hi Alexander,

> To do this we want to generate new bindings for this library with
> patched toLua++ (using existing .pkg files). Where is the best place
> to patch toLua++ to generate try-catch blocks around calls to bound
> code?

I did this for tolua 4.0, and tolua++ probably still uses the same mechanism. 
The places are in function.lua and variable.lua. 

In function.lua: right before the "-- check types" (open a try) and before 
the "output("}")" at the end of the same function (close a try).

In variable.lua: right after the "output("{")" and before the "output("}")" 
(open and close a try, respectively).

This is pretty easy to do ...

One word of warning: doing things this way can really increase the size of the 
compiled binaries. IMHO, in the long run, it would be better to patch Lua to 
be exception-safe, and to compile it as C++ code. This topic has been raised 
several times on the list, so you should be able to find instructions 
somewhere. 

Best regards
- Christian
-- 
Christian Vogler, Ph.D.
Research Scientist, Gallaudet Research Institute
http://gri.gallaudet.edu/~cvogler/