diff options
author | Andy Wingo <wingo@pobox.com> | 2010-02-07 14:16:54 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2010-02-08 13:35:06 +0100 |
commit | 997659f898d94abccdcba3c444b84e3c6f6e963e (patch) | |
tree | 64f1ab2f9657b5f27d7cca16deddece915018dfe | |
parent | babfc7b2c3fce452aa12fed8d89cd3fbc81e8cc8 (diff) | |
download | guile-997659f898d94abccdcba3c444b84e3c6f6e963e.tar.gz |
make scm_make_continuation internal
* libguile/continuations.h:
* libguile/continuations.c (scm_i_make_continuation): Change from
scm_make_continuation, and make internal.
* libguile/vm-i-system.c (call/cc, tail-call/cc): Adapt callers.
* test-suite/standalone/test-unwind.c (check_cont_body): Adapt a test.
* doc/ref/api-control.texi (Continuations): Update docs.
-rw-r--r-- | doc/ref/api-control.texi | 9 | ||||
-rw-r--r-- | libguile/continuations.c | 6 | ||||
-rw-r--r-- | libguile/continuations.h | 2 | ||||
-rw-r--r-- | libguile/eval.c | 2 | ||||
-rw-r--r-- | libguile/vm-i-system.c | 4 | ||||
-rw-r--r-- | test-suite/standalone/test-unwind.c | 6 |
6 files changed, 9 insertions, 20 deletions
diff --git a/doc/ref/api-control.texi b/doc/ref/api-control.texi index b220355ce..c76bdfe0c 100644 --- a/doc/ref/api-control.texi +++ b/doc/ref/api-control.texi @@ -410,15 +410,6 @@ invoke that continuation. This is in common use since the latter is rather long. @end deffn -@deftypefn {C Function} SCM scm_make_continuation (int *first) -Capture the current continuation as described above. The return value -is the new continuation, and @var{*first} is set to 1. - -When the continuation is invoked, @code{scm_make_continuation} will -return again, this time returning the value (or set of multiple -values) passed in that invocation, and with @var{*first} set to 0. -@end deftypefn - @sp 1 @noindent Here is a simple example, diff --git a/libguile/continuations.c b/libguile/continuations.c index e8e91d1ea..6caceca53 100644 --- a/libguile/continuations.c +++ b/libguile/continuations.c @@ -60,7 +60,7 @@ static scm_t_bits tc16_continuation; -/* scm_make_continuation will return a procedure whose objcode contains an +/* scm_i_make_continuation will return a procedure whose objcode contains an instruction to reinstate the continuation. Here, as in gsubr.c and smob.c, we define the form of that trampoline function. */ @@ -189,9 +189,9 @@ continuation_print (SCM obj, SCM port, scm_print_state *state SCM_UNUSED) /* this may return more than once: the first time with the escape procedure, then subsequently with the value to be passed to the continuation. */ -#define FUNC_NAME "scm_make_continuation" +#define FUNC_NAME "scm_i_make_continuation" SCM -scm_make_continuation (int *first) +scm_i_make_continuation (int *first) { scm_i_thread *thread = SCM_I_CURRENT_THREAD; SCM cont; diff --git a/libguile/continuations.h b/libguile/continuations.h index 17960a7a9..93b8dc750 100644 --- a/libguile/continuations.h +++ b/libguile/continuations.h @@ -71,7 +71,7 @@ typedef struct -SCM_API SCM scm_make_continuation (int *first); +SCM_INTERNAL SCM scm_i_make_continuation (int *first); SCM_INTERNAL SCM scm_i_call_with_current_continuation (SCM proc); SCM_INTERNAL SCM scm_i_continuation_to_frame (SCM cont); SCM_INTERNAL void scm_i_continuation_call (SCM cont, size_t n, SCM *argv); diff --git a/libguile/eval.c b/libguile/eval.c index f6b42c5a8..6cfe43807 100644 --- a/libguile/eval.c +++ b/libguile/eval.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009 +/* Copyright (C) 1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010 * Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or diff --git a/libguile/vm-i-system.c b/libguile/vm-i-system.c index 97b952187..de0210010 100644 --- a/libguile/vm-i-system.c +++ b/libguile/vm-i-system.c @@ -1093,7 +1093,7 @@ VM_DEFINE_INSTRUCTION (64, call_cc, "call/cc", 0, 1, 1) SCM proc, cont; POP (proc); SYNC_ALL (); - cont = scm_make_continuation (&first); + cont = scm_i_make_continuation (&first); if (first) { PUSH ((SCM)fp); /* dynamic link */ @@ -1130,7 +1130,7 @@ VM_DEFINE_INSTRUCTION (65, tail_call_cc, "tail-call/cc", 0, 1, 1) SCM proc, cont; POP (proc); SYNC_ALL (); - cont = scm_make_continuation (&first); + cont = scm_i_make_continuation (&first); ASSERT (sp == vp->sp); ASSERT (fp == vp->fp); if (first) diff --git a/test-suite/standalone/test-unwind.c b/test-suite/standalone/test-unwind.c index f333c8c3a..2d6894d7e 100644 --- a/test-suite/standalone/test-unwind.c +++ b/test-suite/standalone/test-unwind.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2004, 2005, 2008, 2009 Free Software Foundation, Inc. +/* Copyright (C) 2004, 2005, 2008, 2009, 2010 Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License @@ -137,12 +137,10 @@ SCM check_cont_body (void *data) { scm_t_dynwind_flags flags = (data? SCM_F_DYNWIND_REWINDABLE : 0); - int first; SCM val; scm_dynwind_begin (flags); - - val = scm_make_continuation (&first); + val = scm_c_eval_string ("(call/cc (lambda (k) k))"); scm_dynwind_end (); return val; } |