[racket] Generics and modules

From: Konrad Hinsen (konrad.hinsen at fastmail.net)
Date: Tue Aug 27 11:53:43 EDT 2013

J. Ian Johnson writes:

 > No, your function is just ill-founded. Do you mean to destruct x to
 > find an inner bar to call gen-foo-far-baz on it?

I want to make the field baz of struct foo-bar accessible through the
generic interface method foo-bar-baz.

The background is that struct foo-bar already exists and is used by
client modules, so I can't change its name or the names of its
fields. The generic interface in module foo also exists and is used by
client modules. I want to implement the interface for my struct.  Any
solution is fine that doesn't require me to change the already
published interfaces of the two modules.

My real situation is not quite as dramatic because none of this code
is published and I am the only user, so I could just change some name
and go on. But I am doing this as an exercise in modular design.

Konrad.

Posted on the users mailing list.