[racket] Generics and modules

From: Konrad Hinsen (konrad.hinsen at fastmail.net)
Date: Tue Aug 27 12:16:16 EDT 2013

Konrad Hinsen writes:

 > Is there a workaround for that case as well?

I found one myself, though it's a bit of a kludge:

-- foo-bar.rkt --------------------------------------------
#lang racket

(provide (all-defined-out))

(require (prefix-in foo: "foo.rkt")
         (only-in racket/generic define/generic))

(define (struct-foo-bar-baz x)
  (foo-bar-baz x))

(struct foo-bar (baz)
        #:methods foo:gen:bar
        [(define (foo-bar-baz x)
           (struct-foo-bar-baz x))])
-----------------------------------------------------------

Thanks to everyone,
  Konrad.

Posted on the users mailing list.