We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eaf7a6d commit 6c3a511Copy full SHA for 6c3a511
typed-racket-doc/typed-racket/scribblings/reference/types.scrbl
@@ -361,7 +361,12 @@ is a subtype of @racket[(Read-Only-Boxof b)] if @racket[a] is a subtype of @rack
361
362
@ex[(box-immutable "hello world")
363
(code:comment "though this does not necessarily imply immutability:")
364
- (if (zero? (random 2)) (box "hello") (box 'hello))]
+ (define b : (Box Integer) (box 3))
365
+ (define b-read-only : (Read-Only-Boxof Integer) b)
366
+ (set-box! b-read-only 5)
367
+ (unbox b-read-only)
368
+ (set-box! b 5)
369
+ (unbox b-read-only)]
370
371
@defidform[BoxTop]{is the type of a @rtech{box} with an unknown element
372
type and is the supertype of all box types. Only read-only box operations
0 commit comments