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
struct-copy doesn't recognize contracted super struct info #3270
Comments
The problem is that https://github.com/racket/racket/blob/master/racket/collects/racket/private/define-struct.rkt#L1002 uses One possible fix is to add yet another struct prop, say, Does this look like a good idea? CC: @mflatt, @rmculpepper |
Can contract-out arrange to make the parent of bar be the foo it is
exporting?
Robby
…On Thu, Jul 2, 2020 at 8:13 AM sorawee ***@***.***> wrote:
The problem is that
https://github.com/racket/racket/blob/master/racket/collects/racket/private/define-struct.rkt#L1002
uses free-identifier=? to test if the specified parent id is the same as
the identifier in the struct info or not. Because contract-out generates
a new identifier, they won't be free-identifier=? to each other.
One possible fix is to add yet another struct prop, say,
struct-identity-info to keep the original identifier around. contract-out
will attach this property, which will allow struct-copy to use the
content of struct-identity-info if it's available. Note that struct infos
generated by define-struct won't need this property.
Does this look like a good idea?
CC: @mflatt <https://github.com/mflatt>, @rmculpepper
<https://github.com/rmculpepper>
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#3270 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADBNMGD7TQRXBSS3CQNJFDRZSBW7ANCNFSM4OKNQK7Q>
.
|
Not really. In fact, a better example is:
In the above program |
Maybe in that example, |
@chrdimo what do you think about these examples? |
Saying that
|
@samth the super struct position was recently deprecated (by me), precisely because I don't have a good way to check that |
Doesn't that imply that the following code should fail?
But clearly, you have put a lot of effort into making it work (impersonator, chaperone, etc.). |
That's a good point. I do think that Which brings us back to the earlier example, where both |
fails with:
Note that this has been failing, even before #2700.
The text was updated successfully, but these errors were encountered: