From 3ac0654ecebb31ebaaf553446244408fcf0f79fc Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 2 Nov 2015 18:30:50 -0800 Subject: Moving sys:capture-cont to call/cc style API. * unwind.c (revive_cont): Don't wrap cons cell around passed arg; just pass it directly. We don't need that convention any more. * capture_cont: Take functional argument. Pass the captured continuation to the function. If the function returns, return whatever it returned. When resuming, return the continuation argument. (uw_capture_cont): Take functional second argument and pass to capture_cont. Context form becomes third argument. (uw_late_init): Update registration of sys:capture-cont to three arguments, two required. * unwind.h (uw_capture_cont): Declaration updated. * share/txr/stdlib/yield.tl (sys:yield-impl): Not needed any more; all this was doing was implementing a call/cc style interface around sys:capture-cont which can now be used directly. (yield-from): Use sys:capture-cont directly. (suspend): Simplified to the point of triviality with new sys:capture-cont. * txr.1: Documented. --- unwind.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'unwind.h') diff --git a/unwind.h b/unwind.h index bcf8d185..5fccabc0 100644 --- a/unwind.h +++ b/unwind.h @@ -125,7 +125,7 @@ uw_frame_t *uw_current_exit_point(void); val uw_get_frames(void); val uw_find_frame(val extype, val frtype); val uw_invoke_catch(val catch_frame, val sym, struct args *); -val uw_capture_cont(val tag, val ctx_form); +val uw_capture_cont(val tag, val fun, val ctx_form); void uw_init(void); void uw_late_init(void); -- cgit v1.2.3