Make control contracts play nice with has-contract?

This commit is contained in:
Asumu Takikawa 2012-11-05 17:25:30 -05:00
parent 321cd1b4ae
commit 68dd17bf08
2 changed files with 23 additions and 2 deletions

View File

@ -1014,7 +1014,8 @@
'(expected: "~s" given: "~e")
(contract-name ctc)
val))
(proxy val proj1 proj2 call/cc-guard call/cc-proxy))))
(proxy val proj1 proj2 call/cc-guard call/cc-proxy
impersonator-prop:contracted ctc))))
(define ((prompt-tag/c-first-order ctc) v)
(continuation-prompt-tag? v))
@ -1074,7 +1075,8 @@
'(expected: "~s" given: "~e")
(contract-name ctc)
val))
(proxy val proj1 proj2))))
(proxy val proj1 proj2
impersonator-prop:contracted ctc))))
(define ((continuation-mark-key/c-first-order ctc) v)
(continuation-mark-key? v))

View File

@ -4218,6 +4218,15 @@
pt)])
(do-test)))
(test/spec-passed/result
'prompt-tag/c-has-contract
'(let ([pt (contract (prompt-tag/c string? number?)
(make-continuation-prompt-tag)
'pos
'neg)])
(has-contract? pt))
#t)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; continuation-mark-key/c
@ -4369,6 +4378,16 @@
'neg)])
(continuation-mark-set-first #f ctc-mark)))
(test/spec-passed/result
'continuation-mark-key/c-has-contract
'(let* ([mark (make-continuation-mark-key)]
[ctc-mark (contract (continuation-mark-key/c number?)
mark
'pos
'neg)])
(has-contract? ctc-mark))
#t)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; make-contract