[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Q] MzScheme and multiple inheritance??




Leo, mzscheme's classes aren't classes. They are mixins.
The keyword is misleading, and we should warn people in 
the manual about this "misperception." 

A mixin is like a class but the super-class specification 
is an expression, not a hard-wired name. Thus you can write
functions that consume classes and produce them: 

(define (add-search-buffer-to-window a-window-class)
  (class a-window-class ... ....))

This is probably the most common use of the super-class expression. 
Another one is that you can write modules (known as "units") and 
inherit across module boundaries -- without knowledge to which module
you're going to link yours. 

We have written that "mixins give you the simplicity of single-inheritance
thinking and the power of multiple inheritance" and we believe in this. If
someone runs across a situation where MI is needed instead of Mixin we'd
like to know. 

-- Matthias