[Ecls-list] Embedding ECL inside a containing C++ program.
Andrew Topp
talmakion at yahoo.com.au
Tue Aug 20 10:23:04 UTC 2002
--- Juan Jose Garcia-Ripoll <jlr at mpq.mpg.de> wrote:
> I do not know how you have used setjmp(). Personally
> I recommend the scheme
> which is used consistently in ECL, and which is
> based on frs_push, cl_throw,
> etc. For example, the right way to implement a CATCH
> statement
>
> if (frs_push(FRS_CATCH,clSmy_symbol) == 0) {
> ....
> /* Invoke lisp code */
> ...
> }
> frs_pop();
>
> Here clSmy_symbol is the object which you must pass
> to THROW so that this
> conditional catches the jump. frs_push(), frs_pop()
> and the associated
> routines take care of calling setjmp() and may be
> subject to important
> changes in the future.
Nifty, I'll look into it:). setjmp() jumps out of
non-returning functions like FEerror(), well, they
can't return, and using catch/throw in the Lisp
universal-error-handler code causes a spam of frame
stack or bind stack overflow errors. I've also got a
setjmp() breaking out of quit to shut down the main
loop (broadcasts a cscmdQuit event) and return control
to UC so it can shutdown correctly.
> How do you access this virtual file system? Are
> there specialized entry
> functions?
>
It uses a completely different set of access methods,
which are performed through an SCF interface (C++
class) called iVFS. Nothing to do with STDIO.
I was thinking of just making a new interface to VFS,
but then things like load won't be able to use it, so
integrating it into the lisp streams would be nice:).
I'd looked into using Boheim's GC on another project
as well, I may give it some experimentation. How it
works is interesting:). Since the plugin completely
wraps around ECL, hiding all internal data
representations (cl_object), there shouldn't be many
references kept floating around.
My prelim plugin was just commited to CVS, you can
have a look at it at
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/unicorp/unicorp/plugins/lisp/lisp.cpp
This isn't production code, its just me fiddling to
get ECL working:).
Thanks,
>> Andrew (talmakion at yahoo.com.au).
http://digital.yahoo.com.au - Yahoo! Digital How To
- Get the best out of your PC!
More information about the ecl-devel
mailing list