New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docs: Unclear impersonator-of?
situation
#4960
Comments
I think your fix makes sense. The situation is similar to an inductive proof where a correct proof needs, say, P(0) and P(5) for base cases, and P(i) -> P(i+1) for the inductive case. If somehow we forget to mark P(5) as a base case, and try to prove it using the inductive clause, the proof might not go through, because P(4) -> P(5) actually doesn't hold. In this situation, the first bullet point is an inductive case, and |
Hmm, another issue occurs to me. These two bullet points seem to apply in the same cases sometimes:
Suppose we have In practice, it seems the second bullet point takes precedence: > (define a add1)
> (define b (impersonate-procedure a (lambda (x) x)))
> (define c (impersonate-procedure b #f impersonator-prop:contracted #f))
> (eq? b c)
#f
> (impersonator-of? b c)
#t I think this additional issue can be addressed by swapping the order of these bullet points and adding "Otherwise," or "If |
I wonder if it would help to write down an accurate but optimization-free implementation of Then, the idea would be to get rid of the detailed prose description but just keep a high-level prose description. |
What version of Racket are you using?
Racket v8.12 [cs]
What program did you run?
At the command-line REPL:
This more or less contradicts the first bullet point in docs for
impersonator-of?
as of 8.12:What should have happened?
I think the docs are unclear here. This is a situation where
v1
impersonatesv1*
but(impersonator-of? v1 v2)
is not the same as(impersonator-of? v1* v2)
.I wouldn't go so far as to say the docs are wrong. This is a situation where
v1
andv2
areeq?
, so it's technically already described by the sentence "Any two values that areeq?
to one another are alsoimpersonator-of?
."I found this confusing because I was approaching the docs to determine "What non-
eq?
chaperones are considered the "same" forchaperone-of?
purposes?" (and thechaperone-of?
docs forwarded me here to theimpersonator-of?
docs). The bulleted list doesn't include any case where bothv1
andv2
are impersonators that might be the "same," and it wasn't obvious that theeq?
sentence was what I was looking for. Theeq?
sentence was was grouped with theequal?
sentence, and theequal?
part was a high-level overview that was redundant with a more detailed description a little later on, so theeq?
part was easy to ignore and forget about.I think rearranging a couple of sentences and inserting an "otherwise" could help indicate that the
eq?
case is a non-redundant detail and that it actually takes precedence in the case where I had thought I found an inaccuracy:I laid out my frame of mind as I was consulting the docs here in case anyone has a better idea of how to approach this or wants me to try something more adventurous myself.
If it'd be preferred to leave the docs alone, I'll understand. I did eventually come around to the answer I was looking for on my own, so I don't necessarily count as an existence proof that they're confusing, heh.
The text was updated successfully, but these errors were encountered: