fix call to raise-argument-error and fix docs for with-roots
This commit is contained in:
parent
62a09958d2
commit
73967fcfec
|
@ -178,7 +178,7 @@
|
||||||
(define rt (getter))
|
(define rt (getter))
|
||||||
(unless (location? rt)
|
(unless (location? rt)
|
||||||
(raise-argument-error 'with-roots
|
(raise-argument-error 'with-roots
|
||||||
'location?
|
"location?"
|
||||||
rt)))
|
rt)))
|
||||||
(parameterize ([user-specified-roots
|
(parameterize ([user-specified-roots
|
||||||
(append
|
(append
|
||||||
|
|
|
@ -127,7 +127,7 @@ Determines if @racket[v] is a root.
|
||||||
]}
|
]}
|
||||||
|
|
||||||
@defform[(with-roots (root-var ...) expr1 expr2 ...)
|
@defform[(with-roots (root-var ...) expr1 expr2 ...)
|
||||||
#:contracts ([roots-expr (listof location?)])]{
|
#:contracts ([root-var location?])]{
|
||||||
Evaluates each of @racket[expr1] and the @racket[expr2]s in
|
Evaluates each of @racket[expr1] and the @racket[expr2]s in
|
||||||
in a context with additional roots, one for each of
|
in a context with additional roots, one for each of
|
||||||
the @racket[root-var]s. The @racket[get-root-set] function
|
the @racket[root-var]s. The @racket[get-root-set] function
|
||||||
|
@ -146,6 +146,7 @@ Determines if @racket[v] is a root.
|
||||||
|
|
||||||
@racketblock[
|
@racketblock[
|
||||||
(test (with-heap (make-vector 4)
|
(test (with-heap (make-vector 4)
|
||||||
|
(init-allocator)
|
||||||
(define f1 (gc:alloc-flat 1))
|
(define f1 (gc:alloc-flat 1))
|
||||||
(define r1 (make-root 'f1
|
(define r1 (make-root 'f1
|
||||||
(λ () f1)
|
(λ () f1)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user