[Ecls-list] Clean ECL exit problem

Juan Jose Garcia-Ripoll lisp at arrakis.es
Fri Jun 30 08:15:56 UTC 2006

2006/6/30, Goffioul Michael <goffioul at imec.be>:
>  What you propose does not change the fact that in normal cases, ECL will
> not execute the exit hooks in a normal state, but always through the
> atexit() handler. I would prefer a scheme where the top-level function is
> exited normally, such that the rest of the main() function can execute
> normally. And this should be the default ECL behavior.

Actually what I had in mind is to have at least two handlers for an exit

1) Default handler calls cl_shutdown() and then exit()

2) When the toplevel is entered, it binds another handler that quits the
toplevel using THROW.

Additionally, a routine called ecl_handler_bind() will be provided for
registering C functions to handle conditions.

This QUIT implementation is annoying when you embed ECL into a larger
> program, because if you send the QUIT command to the LISP engine, it's the
> all program that is crashing.

Yes, I agree, but the meaning of QUIT is indeed very much
application-dependent. There are applications out there that will not use
the toplevel, but define its own. The THROW solution is there a hack,
because we have to expose the value of the throw tag, etc, etc.

One can provide two alternatives: either each one is forced to redefine QUIT
(in your case this is a good temporary solution) or you provide a robust
mechanism as the one defined before, where people can intercept the exit
conditions -- and even ignore them compeletely!



Max-Planck-Institut für Quantenoptik
Hans-Kopfermann-Str. 1, Garching, D-85748, Germany
Phone: +49 89 32905 345   Fax: +49 89 32905 336
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20060630/860eb62b/attachment.html>

More information about the ecl-devel mailing list