[racket] Racket v5.3

From: Asumu Takikawa (asumu at ccs.neu.edu)
Date: Tue Aug 14 10:17:02 EDT 2012

On 2012-08-13 13:28:07 -0700, Jordan Johnson wrote:
> I'm curious:  what use cases call for the new generics as opposed to
> the old class & interface system?  I'm trying to get a clearer picture
> of the motivation for the new functionality, and the differences
> between old-style class-based OO code and this struct-based kind.

This feature isn't intended to replace class-based OO code. Notably,
these generics don't have inheritance, overriding, mixins, and other
"heavyweight" features that you might use with the class system.

Instead, racket/generic is intended to replace the use of struct type
properties as a mechanism to add generic behavior to datatypes. Before
this library, generic functions like `dict-ref` or `stream-first` relied
on ad-hoc protocols where a struct would provide a collection of
functions to implement dictionary operations.

Now we provide a unified and consistent way to define such generic
functions and implement their behavior on specific instances.


Posted on the users mailing list.