diff --git a/pkgs/racket-doc/scribblings/reference/chaperones.scrbl b/pkgs/racket-doc/scribblings/reference/chaperones.scrbl index cf97f6c0fd..832f1cc4fc 100644 --- a/pkgs/racket-doc/scribblings/reference/chaperones.scrbl +++ b/pkgs/racket-doc/scribblings/reference/chaperones.scrbl @@ -1076,7 +1076,7 @@ given. @defproc[(make-impersonator-property [name symbol?]) (values impersonator-property? (-> any/c boolean?) - (-> impersonator? any))]{ + (->* (impersonator?) (any/c) any))]{ Creates a new @tech{impersonator property} and returns three values: @@ -1095,7 +1095,11 @@ Creates a new @tech{impersonator property} and returns three values: returns the value associated with an impersonator for the property; if a value given to the accessor is not an impersonator or does not have a value for the property (i.e. if the corresponding impersonator - property predicate returns @racket[#f]), the @exnraise[exn:fail:contract].} + property predicate returns @racket[#f]), then a second optional argument + to the selector determines its response: the @exnraise[exn:fail:contract] + is if a second argument is not provided, the second argument is tail-called + with zero arguments if it is a procedure, and the second argument is returned + otherwise.} ]} diff --git a/pkgs/racket-test-core/tests/racket/chaperone.rktl b/pkgs/racket-test-core/tests/racket/chaperone.rktl index 978c930cec..e2b4a9f740 100644 --- a/pkgs/racket-test-core/tests/racket/chaperone.rktl +++ b/pkgs/racket-test-core/tests/racket/chaperone.rktl @@ -271,6 +271,8 @@ (exn-message exn)))) (err/rt-test (get1 v1) handler) + (test 'no get1 v1 'no) + (test 'no get1 v1 (lambda () 'no)) (err/rt-test (get1 v2) handler) (err/rt-test (get1 v3) handler) (err/rt-test (get1 v4) handler)