Displaying lisp errors while running with save_eval

Diogo Franco diogoalexfranco at gmail.com
Tue Dec 8 17:18:19 UTC 2015


Hello,

I wrote the previous mail on the phone by memory, sorry. I meant i'm using
cl_safe_eval, which you understood correctly.

I understand that cl_safe_eval(form, env, value) is just a macro
to si_safe_eval(3,form,env,value), so i tried si_save_eval(2,
c_string_to_obj(_expr), Cnil) as per your suggestion and it works like a
charm.

This is great for faster development!

Many thanks Daniel,
Diogo

On 8 December 2015 at 06:34, Daniel Kochmański <daniel at turtleware.eu> wrote:

> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20151208/70f5401e/attachment.html>


More information about the ecl-devel mailing list