Improve type of call-with-continuation-prompt

Now works with the handler argument omitted, in which case
the default handler is used. Note that the default handler
cannot be used in conjunction with the default prompt tag
because it is unsound to do so.
This commit is contained in:
Asumu Takikawa 2012-11-07 17:40:06 -05:00
parent 42b07475e9
commit 4e0b38ea79
2 changed files with 11 additions and 1 deletions

View File

@ -19,4 +19,13 @@
(abort-current-continuation pt2 k))
pt2)))
pt2
(λ: ([f : (Integer -> Integer)]) (f 5)))
(λ: ([f : (Integer -> Integer)]) (f 5)))
;; Test the default handler
(: pt3 (Prompt-Tag Integer ((-> Integer) -> Integer)))
(define pt3 (make-continuation-prompt-tag))
(+ 2
(call-with-continuation-prompt
(λ () (+ 1 (abort-current-continuation pt3 (λ () 5))))
pt3))

View File

@ -2021,6 +2021,7 @@
[call-with-continuation-prompt
(-polydots (a b d c)
(cl->*
(-> (-> b) (make-Prompt-Tag b (-> (-> d) d)) (Un b d))
(-> (-> b) (make-Prompt-Tag b (->... '() (c c) d)) (->... '() (c c) d)
(Un b d))
(-> (-> b) Univ)))]