diff --git a/pkgs/racket-doc/scribblings/reference/chaperones.scrbl b/pkgs/racket-doc/scribblings/reference/chaperones.scrbl index c5281a364c..369f5bf80c 100644 --- a/pkgs/racket-doc/scribblings/reference/chaperones.scrbl +++ b/pkgs/racket-doc/scribblings/reference/chaperones.scrbl @@ -86,59 +86,19 @@ the same reason that they should avoid @racket[impersonator?].} Indicates whether @racket[v1] can be considered equivalent modulo impersonators to @racket[v2]. +Any two values that are @racket[eq?] to one another are also @racket[impersonator-of?]. For values that include no impersonators, @racket[v1] and @racket[v2] can be considered impersonators of each other if they are @racket[equal?]. -Otherwise, impersonators within @racket[v2] must be intact within -@racket[v1]: - +Otherwise at least one of @racket[v1] or @racket[v2] is an impersonator. @itemlist[ - - @item{If a part of @racket[v2] is an impersonator created from one of - the impersonator constructors (e.g., - @racket[impersonate-procedure] or - @racket[chaperone-procedure]), and if the impersonator is - constructed with at least one redirection procedure (i.e., a - value other than @racket[#f] was supplied for a redirection - procedure), then the corresponding part of @racket[v1] must be - one of the following: - - @itemlist[ - - @item{the same value that is a part of @racket[v2] (with a - special meaning of ``the same value`` in the case of - immutable hash tables, as described below);} - - @item{a value further derived from the same value that is - part of @racket[v2] using an impersonator constructor; - or} - - @item{a value with the @racket[prop:impersonator-of] property - whose procedure produces an impersonator of the same value - that is part of @racket[v2].} - - ] - - For most kinds of values, ``the same value'' means equal - according to @racket[eq?]. In the case of an immutable hash - table, two impersonated hash tables count as ``the same value'' - when their redirection procedures were originally attached to a - hash table by the same call to @racket[impersonate-hash] or - @racket[chaperone-hash] (and potentially propagated by - @racket[hash-set], @racket[hash-remove], or - @racket[hash-clear]), as long as the content of the first hash - table is @racket[impersonator-of?] of the second hash table.} - - @item{If a part of @racket[v2] is a structure or procedure impersonator that was - created with no redirection procedures (i.e, @racket[#f] in - place of all redirection procedures for specified operations), - then the impersonated value is considered in place of that part - of @racket[v2]. In other words, an impersonator construction - that does not redirect any access or mutation (but that - includes some @tech{impersonator properties}) need not be - preserved in @racket[v1].} - -]} + @item{If @racket[v1] impersonates @racket[_v1*] then @racket[(impersonator-of? v1 v2)] + is @racket[#t] if and only if @racket[(impersonator-of? _v1* v2)] is @racket[#t].} + @item{If @racket[v2] is a non-interposing impersonator that impersonates @racket[_v2*], i.e., + all of its interposition procedures are @racket[#f], then @racket[(impersonator-of? v1 v2)] + is @racket[#t] if and only if @racket[(impersonator-of? v1 _v2*)] is @racket[#t].} + @item{When @racket[v2] is an impersonator constructed with at least one non-@racket[#f] interposition procedure, + but @racket[v1] is not an impersonator then @racket[(impersonator-of? v1 v2)] is @racket[#f].}]} @defproc[(chaperone-of? [v1 any/c] [v2 any/c]) boolean?]{