Add types for box-cas!, unsafe-box*-cas!

This commit is contained in:
Asumu Takikawa 2016-03-23 16:02:22 -04:00
parent 495da1bd1a
commit 812f1a8c79
2 changed files with 7 additions and 0 deletions

View File

@ -876,6 +876,7 @@
((-box a) . -> . a)
((make-BoxTop) . -> . Univ)))]
[set-box! (-poly (a) ((-box a) a . -> . -Void))]
[box-cas! (-poly (a) ((-box a) a a . -> . -Boolean))]
[unsafe-unbox (-poly (a) (cl->*
((-box a) . -> . a)
((make-BoxTop) . -> . Univ)))]
@ -884,6 +885,7 @@
((-box a) . -> . a)
((make-BoxTop) . -> . Univ)))]
[unsafe-set-box*! (-poly (a) ((-box a) a . -> . -Void))]
[unsafe-box*-cas! (-poly (a) ((-box a) a a . -> . -Boolean))]
[box? (make-pred-ty (make-BoxTop))]
;; Section 4.13 (Hash Tables)

View File

@ -301,6 +301,7 @@
racket/system
racket/tcp
racket/udp
racket/unsafe/ops
racket/vector
syntax/stx
@ -1951,6 +1952,10 @@
(struct-type-property? prop))
#:ret (ret -Boolean -true-filter))
;; Boxes
[tc-e (box-cas! (box "foo") "bar" "baz") -Boolean]
[tc-e (unsafe-box*-cas! (box "foo") "bar" "baz") -Boolean]
;; Weak boxes
[tc-e (make-weak-box "foo") (-weak-box -String)]
[tc-e (weak-box-value (make-weak-box "foo")) (-opt -String)]