: continuation->rstack-list
drop pair-type cdr ;
-: restore-param-stack ( continuation -- obj_stack continuation )
-
+: restore-param-stack ( continuation -- obj_stack )
continuation->pstack-list
2dup >R >R
-2 +loop
2drop
+;
+
+: restore-return-stack ( continuation -- )
+
+ R> -rot \ store top of return stack on PS
+ continuation->rstack-list
+ 2dup print 2dup
+
+ \ TODO: Implement body of return stack restoration
+ >R \ restore original top of return stack
;
-: restore-continuation
+: restore-continuation ( continuation -- )
\ TODO: replace current parameter and return stacks with
\ contents of continuation object.
+
+ 2dup >R >R
+ restore-param-stack
+
+ ." ====== PARAM STACK RESTORED ======" cr
+ trace
+
+ R> R>
+ restore-return-stack
;
\ }}}
\ }}}
+\ DEBUGGING
xxxx
\ ---- Loading files ---- {{{