This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Guile & C++



 > Guile is written in C; it doesn't use any C++ features. So the Guile
 > catch and throw mechanisms are implemented in terms of longjmp and
 > setjmp, and probably don't interact in any particular way with C++'s
 > exception mechanisms.

 And how hard it would be to make standard guile C++ aware? 

 I came up with only one solution (I am not C++ guru and definitely not guile
guru, so please tell me if my solution is not correct): When entering C++ code
from Guile then set up own try & catch which `translates' any C++ exceptions 
to scheme and then use gh_throw. When I call scheme code from guile I have to
install my own scm_error_callback (and `translate' scheme exceptions to C++), am
I right or did I missed something?

 Another thing I would like to ask about is smob - I want to wrap my own types
for guile and from guile-gtk sources I know that this could be done by smobs -
but unfortunately smobs are not documented - is this feature too deep in guile
for ordinary user or is there any other way to wrap new C types?

Dan