Add suspendable-continuation?
* doc/ref/api-control.texi (Prompt Primitives): Document
suspendable-continuation?.
* libguile/control.c (scm_suspendable_continuation_p): New procedure.
(scm_init_ice_9_control): New extension procedure, defines
suspendable-continuation?.
(scm_init_control): Register scm_init_ice_9_control.
* libguile/eval.c (eval):
* libguile/throw.c (catch):
* libguile/continuations.c (scm_i_make_continuation): Restore resumable
prompt cookie after continuation invocation.
* libguile/vm.c (scm_call_n): Arrange to set resumable_prompt_cookie
during invocation of VM.
* libguile/vm.h (struct scm_vm): Add resumable_prompt_cookie member.
* module/ice-9/control.scm: Export suspendable-continuation?.
* test-suite/tests/control.test ("suspendable-continuation?"): New
test.
This commit is contained in:
parent
bf4a97898b
commit
6dd87f4d8c
9 changed files with 104 additions and 4 deletions
|
|
@ -425,6 +425,7 @@ eval (SCM x, SCM env)
|
|||
struct scm_vm *vp;
|
||||
SCM k, handler, res;
|
||||
scm_i_jmp_buf registers;
|
||||
const void *prev_cookie;
|
||||
scm_t_ptrdiff saved_stack_depth;
|
||||
|
||||
k = EVAL1 (CAR (mx), env);
|
||||
|
|
@ -442,9 +443,11 @@ eval (SCM x, SCM env)
|
|||
vp->ip,
|
||||
®isters);
|
||||
|
||||
prev_cookie = vp->resumable_prompt_cookie;
|
||||
if (SCM_I_SETJMP (registers))
|
||||
{
|
||||
/* The prompt exited nonlocally. */
|
||||
vp->resumable_prompt_cookie = prev_cookie;
|
||||
scm_gc_after_nonlocal_exit ();
|
||||
proc = handler;
|
||||
args = scm_i_prompt_pop_abort_args_x (vp, saved_stack_depth);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue