si_safe_eval and try/catch blocks

I am giving user access to the interpreter and need to prevent Lisp from jumping into debugger should error happen. si_safe_eval does provide this functionality when a third value is provided, but it does not seem like an adequate solution. I need an error to be returned and printed, but si_safe_eval returns whatever third value was supplied instead.

The deprecated cl_eval, on the other hand, does provide what is needed, with a sort of try/catch block:

ECL_HANDLER_CASE_BEGIN ...
{
    cl_eval (forms);
} ECL_HANDLER_CASE ... {
    // Instead of debugger this is executed, print, examine error, etc.
} ECL_HANDLER_CASE_END;

I would have continued using cl_eval, but documentation says it is deprecated. si_safe_eval does not work with the above macros.

Is there a way to achieve same functionality with si_safe_eval?

Assignee Loading
Time tracking Loading