[racket] struct-copy with sub-types

From: Pierpaolo Bernardi (olopierpa at gmail.com)
Date: Fri Mar 25 11:29:58 EDT 2011

On Fri, Mar 25, 2011 at 16:17, Nadeem Abdul Hamid <nadeem at acm.org> wrote:
> Ok, yes, on second thought, I guess it is fine. With your fix,
>
> (struct-copy sub (sub 1 2 3) [c 4])   ==> (sub 1 2 4)
> (struct-copy sub (sub 1 2 3) [b 4])   ==> (sub 1 4 3)
> (struct-copy base (sub 1 2 3) [b 4]) ===> (base 1 4)
>
> is that right? So that sentence applies to the third situation.
>
> I guess when the second one didn't work, I assumed somehow that "id"
> could only be the struct type where the field was actually defined. So
> it was a bug. Sorry for the confusion,

Isn't the second case the case Robby said it still doesn't work?



Posted on the users mailing list.