[plt-scheme] Multiple inheritance problem with mixins
Hi,
I have some shared functionality between two mixins that shouldn't
know about each other. I wanted to implement the shared functionality
as another mixin, but I get an error:
class*: superclass already contains method: m for class: stdin::57
Is there a good way to abstract out shared functionality from two
mixins? This is the distilled example:
(require (lib "class.ss"))
(define (shared-mixin %)
(class %
(super-new)
(define/public (set-expansion x) (void))
(define/public (get-expansion) (void))))
(define (tab-completion %)
(class (shared-mixin %)
(super-new)
(inherit set-expansion get-expansion)))
(define (online-error-reporting %)
(class (shared-mixin %)
(super-new)
(inherit set-expansion get-expansion)))
(define the-class% (online-error-reporting (tab-completion object%)))
Daniel