[racket-dev] Generics and data structures

From: Asumu Takikawa (asumu at ccs.neu.edu)
Date: Wed May 9 21:36:08 EDT 2012

On 2012-05-09 18:02:04 -0600, Ryan Culpepper wrote:
> See the 'supers' argument to 'make-struct-type-property'.
>
> Create 'real-prop:sequence' that takes a vector (compatible with
> generics library).
>
> Define 'prop:sequence' as a backwards compatibility property that
> takes an old-style implementation and transforms it into the
> new-style implementation vector. 'prop:dict/contract' plays the same
> trick, IIRC.

Thanks! That seems like it will work nicely. It turns out that over
dinner, after sending out the e-mail, Vincent and I came up with a
similar solution. It's nice to know that this pattern is already
supported by struct properties.

It should even work with sequences, which we thought were difficult. You
just need to create a vector of methods that just apply the normal
sequence functions to the sequence created by `make-do-sequence`.

We will try to implement this tomorrow.

Cheers,
Asumu

Posted on the dev mailing list.