summaryrefslogtreecommitdiff
path: root/libguile/control.h
diff options
context:
space:
mode:
authorAndy Wingo <wingo@pobox.com>2010-02-26 13:05:25 +0100
committerAndy Wingo <wingo@pobox.com>2010-02-26 13:05:25 +0100
commitadbdfd6d2418b1404af48d480c2273f501517d6e (patch)
tree9624620bcedfbdd1cc29a9454b2cbcfdebdf808b /libguile/control.h
parent416f26c7534a018c59f1c8d888dc9153f42d86d1 (diff)
downloadguile-adbdfd6d2418b1404af48d480c2273f501517d6e.tar.gz
rewinding prompts works
* libguile/control.h (SCM_PROMPT_HANDLER): Remove, it was unused. (SCM_PROMPT_DYNWINDS): Rename from SCM_PROMPT_DYNENV. * libguile/control.c: (scm_c_make_prompt): Take another arg, the winds that are to be in place for the prompt. Fix allocation to be 4 words instead of 5 (the handler was never used). * libguile/eval.c (eval): * libguile/throw.c (pre_init_catch): Adapt to scm_c_make_prompt change. * libguile/vm-i-system.c (partial-cont-call): Grovel the new elements of the wind list in order to call setjmp() on the new prompts. Pass cookie to vm_reinstate_partial_continuation. (prompt): Adapt to scm_c_make_prompt change. * libguile/vm.c (vm_reinstate_partial_continuation): Take a cookie arg, used when winding captured prompts onto the stack. Winding a prompt implies making a new prompt, actually -- with new registers, a new jump buffer, new winds, etc. * test-suite/tests/control.test ("rewinding prompts"): Add a test for rewinding prompts.
Diffstat (limited to 'libguile/control.h')
-rw-r--r--libguile/control.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/libguile/control.h b/libguile/control.h
index 806a8eef0..923a45e0c 100644
--- a/libguile/control.h
+++ b/libguile/control.h
@@ -27,8 +27,7 @@
#define SCM_PROMPT_ESCAPE_P(x) (SCM_PROMPT_FLAGS (x) & SCM_F_PROMPT_ESCAPE)
#define SCM_PROMPT_TAG(x) (SCM_CELL_OBJECT ((x), 1))
#define SCM_PROMPT_REGISTERS(x) ((struct scm_prompt_registers*)SCM_CELL_WORD ((x), 2))
-#define SCM_PROMPT_DYNENV(x) (SCM_CELL_OBJECT ((x), 3))
-#define SCM_PROMPT_HANDLER(x) (SCM_CELL_OBJECT ((x), 4))
+#define SCM_PROMPT_DYNWINDS(x) (SCM_CELL_OBJECT ((x), 3))
#define SCM_PROMPT_SETJMP(p) (SCM_I_SETJMP (SCM_PROMPT_REGISTERS (p)->regs))
@@ -48,7 +47,8 @@ SCM_INTERNAL SCM scm_sys_default_prompt_tag;
SCM_INTERNAL SCM scm_c_make_prompt (SCM k, SCM *fp, SCM *sp,
scm_t_uint8 *abort_ip,
scm_t_uint8 escape_only_p,
- scm_t_int64 vm_cookie);
+ scm_t_int64 vm_cookie,
+ SCM winds);
SCM_INTERNAL SCM scm_i_prompt_pop_abort_args_x (SCM prompt);
SCM_INTERNAL void scm_c_abort (SCM vm, SCM tag, size_t n, SCM *argv,