The Lambda Lab
/
projects
/
scheme.forth.jl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
41b469d
)
Tiny edits to continuation code.
author
Tim Vaughan
<tgvaughan@gmail.com>
Thu, 12 Oct 2017 18:46:31 +0000
(20:46 +0200)
committer
Tim Vaughan
<tgvaughan@gmail.com>
Thu, 12 Oct 2017 18:46:31 +0000
(20:46 +0200)
src/scheme.4th
patch
|
blob
|
history
diff --git
a/src/scheme.4th
b/src/scheme.4th
index
9ad4fb3
..
e94796c
100644
(file)
--- a/
src/scheme.4th
+++ b/
src/scheme.4th
@@
-560,6
+560,21
@@
global-env obj!
cons drop continuation-type
;
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.
: restore-continuation
\ TODO: replace current parameter and return stacks with
\ contents of continuation object.