mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-16 00:30:21 +02:00
$prompt is now its own kind of CPS term.
* module/language/cps.scm ($prompt): Rework to be its own term kind. Now $continue always continues to a single continuation. Adapt callers.
This commit is contained in:
parent
29fee39c2a
commit
ee15ca1455
22 changed files with 198 additions and 195 deletions
|
@ -77,11 +77,11 @@
|
|||
(($ $primcall name param args)
|
||||
(ref* args))
|
||||
(($ $values args)
|
||||
(ref* args))
|
||||
(($ $prompt escape? tag handler)
|
||||
(ref tag))))
|
||||
(ref* args))))
|
||||
(($ $kargs _ _ ($ $branch kf kt src op param args))
|
||||
(ref* args))
|
||||
(($ $kargs _ _ ($ $prompt k kh src escape? tag))
|
||||
(ref tag))
|
||||
(_
|
||||
(values single multiple))))
|
||||
(let*-values (((single multiple) (values empty-intset empty-intset))
|
||||
|
@ -188,12 +188,9 @@
|
|||
(($ $kfun src meta self ktail kclause) (ref2 ktail kclause))
|
||||
(($ $ktail) (ref0))
|
||||
(($ $kclause arity kbody kalt) (ref2 kbody kalt))
|
||||
(($ $kargs names syms ($ $continue k src exp))
|
||||
(match exp
|
||||
(($ $prompt _ _ handler) (ref2 k handler))
|
||||
(_ (ref1 k))))
|
||||
(($ $kargs names syms ($ $branch kf kt))
|
||||
(ref2 kf kt))))
|
||||
(($ $kargs names syms ($ $continue k)) (ref1 k))
|
||||
(($ $kargs names syms ($ $branch kf kt)) (ref2 kf kt))
|
||||
(($ $kargs names syms ($ $prompt k kh)) (ref2 k kh))))
|
||||
(let*-values (((single multiple) (values empty-intset empty-intset))
|
||||
((single multiple) (intset-fold add-ref body single multiple)))
|
||||
(intset-subtract (persistent-intset single)
|
||||
|
@ -259,11 +256,11 @@
|
|||
(($ $primcall name param args)
|
||||
($primcall name param ,(map subst args)))
|
||||
(($ $values args)
|
||||
($values ,(map subst args)))
|
||||
(($ $prompt escape? tag handler)
|
||||
($prompt escape? (subst tag) handler)))))
|
||||
($values ,(map subst args))))))
|
||||
(($ $branch kf kt src op param args)
|
||||
($branch kf kt src op param ,(map subst args))))))
|
||||
($branch kf kt src op param ,(map subst args)))
|
||||
(($ $prompt k kh src escape? tag)
|
||||
($prompt k kh src escape? (subst tag))))))
|
||||
(transform-conts
|
||||
(lambda (label cont)
|
||||
(rewrite-cont cont
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue