X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Fscheme.4th;h=e94796c550ef26630bb7ab426c42a4f58716b225;hb=1611b5484902b38774e0e61b84a14868dcc30152;hp=9ad4fb3c38aa1ecf79c0e5468a6f04dace1723e2;hpb=41b469d050586a05cd43fdd4c78755616af3f7b4;p=scheme.forth.jl.git 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.