Displaying lisp errors while running with save_eval

Daniel Kochmański daniel at turtleware.eu
Tue Dec 8 06:34:44 UTC 2015


Hello,

do you mean si_safe_eval? I can't find save_eval function, but
si_safe_eval prints the error if desired.

I've added corresponding documentation issue:
https://gitlab.com/embeddable-common-lisp/ecl/issues/197

Generally, if you provice si_safe_eval with four arguments (incliding
the nargs), then on error the fourth one will be returned. If you
provide only three arguments, then standard debugger will be invoked and
error printed (note, that you may unwind protect it, and then only the
error should be printed).

It's a feature, because often we don't want these things in the
production code, we just want to be able to verify, if an error
occurs. So if you want "normal" handling of the errors, invoke it like
this:

si_safe_eval(2, c_string_to_object("(hi-jack)"), ECL_NIL);

(or if you want some other environment, use it instead of ECL_NIL,
i.e. ecl_process_env()).

Best regards,
Daniel

Diogo Franco writes:

> Hi all,
>
> Uncaught error conditions in lisp code don't display in *standard-output*
> for me, when ecl is running embedded in c (i presume the reason is that i'm
> calling the lisp functions using save_eval()).
>
> My workflow on the shell while developing is then to do ctrl-c which drops
> me to the REPL, and to manually execute the functions, which will print the
> error.
>
> I'm no expert on the inner workings of ecl, so forgive me if this is a dumb
> question, but is there some way to get the errors in *standard-output* even
> when using save_eval()?
>
> Thanks in advance,
> Diogo Franco

-- 
Daniel Kochmański ;; aka jackdaniel | Poznań, Poland
TurtleWare - Daniel Kochmański      | www.turtleware.eu

"Be the change that you wish to see in the world." - Mahatma Gandhi



More information about the ecl-devel mailing list