mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-15 16:20:17 +02:00
Add new interface to catch/throw, usable from C as well as
Scheme. * throw.h (scm_catch_body_t, scm_catch_handler_t): New types. (scm_internal_catch): New function, replaces... (scm_catch_apply): Deleted. * throw.c (scm_catch_apply): Deleted; replaced with a more general mechanism which is a bit more code, but can be used nicely from C and implement the Scheme semantics as well. (scm_internal_catch): This is the replacement; it's named after the analogous function in Emacs. (scm_catch): Reimplemented in terms of the above. (struct catch_body_data, catch_body, catch_handler): New functions, used by scm_catch. * root.c (cwdr): Reimplemented in terms of scm_internal_catch. (struct cwdr_body_data, cwdr_body, cwdr_handler): New functions; support for new cwdr.
This commit is contained in:
parent
10f74a138b
commit
650fa1abe5
3 changed files with 196 additions and 19 deletions
|
@ -48,7 +48,15 @@
|
|||
|
||||
|
||||
|
||||
extern SCM scm_catch_apply SCM_P ((SCM tag, SCM proc, SCM a1, SCM args, SCM handler));
|
||||
typedef SCM (*scm_catch_body_t) SCM_P ((void *data, SCM jmpbuf));
|
||||
typedef SCM (*scm_catch_handler_t) SCM_P ((void *data,
|
||||
SCM tag, SCM throw_args));
|
||||
|
||||
extern SCM scm_internal_catch SCM_P ((SCM tag,
|
||||
scm_catch_body_t body,
|
||||
scm_catch_handler_t handler,
|
||||
void *data));
|
||||
|
||||
extern SCM scm_catch SCM_P ((SCM tag, SCM thunk, SCM handler));
|
||||
extern SCM scm_lazy_catch SCM_P ((SCM tag, SCM thunk, SCM handler));
|
||||
extern SCM scm_ithrow SCM_P ((SCM key, SCM args, int noreturn));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue