> On 7 Jan 2015, at 21:24, Ludovic Courtès <l...@gnu.org> wrote: > > If Scheme code calls C++ code that throws an exception, then the stack > will be unwound by libstdc++ and Guile’s ‘dynamic-wind’ handlers and > such will not run.
If one tries to pass a C++ exception through Guile code, it will not catch in C++ code above it, I think. > That’s probably the main difficulty. There is a gcc option, but someone said it does not work well, perhaps because any intermediate library and package functions must be recompiled as well. Another variation might be compile C as C++, i.e. writing Guile in the common C/C++ subset. The Bison skeleton file had that before making a genuine C++ one, though it proved too difficult to maintain, and in addition, one does not get access to C++ features. > Likewise when C++ code calls Scheme code. For this, I made a smob and convert Guile errors to a C++ exception. Might be an overhead problem, though. > TeXmacs and LilyPond both embed Guile in a C++ code base so their > developers probably have more insight into this. Since these are old > projects, it could be that they don’t use C++ exceptions. C++ exceptions were there since 1993.