From 21f717beb4eb3d08fc2c615546575734e111e630 Mon Sep 17 00:00:00 2001 From: Asumu Takikawa Date: Mon, 9 Sep 2013 15:01:17 -0400 Subject: [PATCH] Add a caveat about set! original commit: 7bc208a7361058da28c84f5b28327c4408eb4418 --- .../typed-racket/scribblings/guide/occurrence.scrbl | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/typed-racket-pkgs/typed-racket-doc/typed-racket/scribblings/guide/occurrence.scrbl b/pkgs/typed-racket-pkgs/typed-racket-doc/typed-racket/scribblings/guide/occurrence.scrbl index c21676ce..fc689cbd 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-doc/typed-racket/scribblings/guide/occurrence.scrbl +++ b/pkgs/typed-racket-pkgs/typed-racket-doc/typed-racket/scribblings/guide/occurrence.scrbl @@ -140,3 +140,13 @@ essentially equivalent to the following: diff (error "Assertion failed")))) ] + +@section{A caveat about @racket[set!]} + +If a variable is ever mutated with @racket[set!] in the scope in +which it is defined, Typed Racket cannot use occurrence typing with +that variable. This precaution is needed to ensure that concurrent +modification of a variable does not invalidate Typed Racket's +knowledge of the type of that variable. Also see +@Secref["using-set!" #:doc '(lib "scribblings/guide/guide.scrbl")]. +