[Ecls-list] ecl-standalone *feature* or similar?

Juan Jose Garcia-Ripoll juanjose.garciaripoll at googlemail.com
Fri Aug 14 09:07:50 UTC 2009


Hi

Matthew, if you need a "standalone" feature, then why do yo not cook
it for your own project?

(pushnew :mm-standalone-program *features*)
...
mymain.lisp

#+:mm-standalone-program
...

But the real and elegant way, is to use :epilogue...

> So I tried writing an arguments processing function (standalone-main)
> and passing '(socket-test:standalone-main) as :epilogue-code to
> c::build-program, but this doesn't seem to work well (it appears that
> the exceptions system is not yet initialized when the function is
> invoked, so "Connected" gets printed even if an exception should occur
> when attempting to connect to an unbound port, for instance).  Is this
> expected?

There is no such thing as an installed exception system. Conditions do
not have handlers by default, except if you launch the toplevel, which
then installs a default handler that calls the debugger. If you want
to catch errors in the epilogue code you will have to include in
standalone-main a handler-bind or handler-case statement that captures
all uncaught exceptions.

Please do not ask me to include a default handler for exceptions,
because that would break people's code. If I do something like
    (handler-bind ((error #'my-error-handler)) ...)
this may have priority over other people's installed handlers. This is
indeed what broke the original condition handling code in ECL's
compiler: top-level installed its own handlers for all conditions and
the debugger was never invoked.

Juanjo

-- 
Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain)
http://juanjose.garciaripoll.googlepages.com




More information about the ecl-devel mailing list