[Ecls-list] Embedding ECL in a C++ app.

Goffioul Michael goffioul at imec.be
Thu Feb 2 06:59:01 UTC 2006


> 1.  How to catch errors in the C++ part?  I use si_safe_eval 
> to run the Lisp code.  When there is an error in it, the Lisp 
> debugger runs. 
> In a while, I'd probably try to have a REPL, listening on a 
> different port, but for now (and for the production system), 
> I'd like to just log the error.

In my embedded ECL, I do it by setting *debugger-hook* to an internal
handler routine.

> 2.  The C++ app doesn't use a garbage collector, but I don't 
> know what happens when I link it with ECL, and through that, 
> with Boehm's GC. 
> Any pointers (pun unintended, but noticed)?

AFAIK, the GC only cares about LISP objects.

> 3.  I don't want to complicate the build process more than 
> it's absolutely necessary, so I don't use the fancy Lisp like 
> C++ macros @(defun ...) and friends, but I still want to 
> define Lisp functions with &optional, &keyword, and &rest 
> argument lists from C.  How?

I guess by writing a dummy .d file, running dpp on it and looking at the
result. However, because it's ECL's internal, I don't know if the code
structure is subject to change, hence you might have portability issues.

Michael.




More information about the ecl-devel mailing list