From 1611b5484902b38774e0e61b84a14868dcc30152 Mon Sep 17 00:00:00 2001 From: Tim Vaughan Date: Thu, 12 Oct 2017 20:46:31 +0200 Subject: [PATCH] Tiny edits to continuation code. --- src/scheme.4th | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/scheme.4th b/src/scheme.4th index 9ad4fb3..e94796c 100644 --- a/src/scheme.4th +++ b/src/scheme.4th @@ -560,6 +560,21 @@ global-env obj! cons drop continuation-type ; +: continuation->pstack-list + drop pair-type car ; + +: continuation->rstack-list + drop pair-type cdr ; + +: restore-param-stack ( continuation -- obj_stack continuation ) + + 2dup >R >R + continuation->pstack-list + + ( Idea: allocate stack space first using psp!, + then copy objects from list. ) +; + : restore-continuation \ TODO: replace current parameter and return stacks with \ contents of continuation object. -- 2.20.1