CL_CATCH_ALL
— Create a protected region.
cl_env_ptr env = ecl_process_env();
CL_CATCH_ALL_BEGIN(env) {
/*
* Code that is protected. Uncaught lisp conditions, THROW,
* signals such as SIGSEGV and SIGBUS may cause jump to
* this region.
*/
} CL_CATCH_ALL_IF_CAUGHT {
/*
* If the exception, lisp condition or other control transfer
* is caught, this code is executed.
*/
} CL_CATCH_ALL_END
/*
* In all cases we exit here.
*/
This is a set of three macros that create an
UNWIND-PROTECT region that prevents any nonlocal transfer
of control to outer loops. In the Lisp speak, the previous code is
equivalent to
(block nil
(unwind-protect
(progn
;; Code that is protected
)
(return nil)))
As explained in CL_UNWIND_PROTECT,it is normally advisable to set up an unwind-protect frame to avoid the embedded lisp code to perform arbitary transfers of control.