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

Re: MI: why?



Charles Hixson <charleshixsn@earthlink.net> wrote:
> 
> To my eyes, the real problem is slightly different:
>
> How does one express the ancestry of a rhombus, a square, a rectangle, a
> rotatable rectangle, a round-cornered rectangle, and an equilateral
> triangle.  I've yet to see an inheritance diagram that made any sense.  It
> makes me wonder is something basic is wrong with the very concept of
> inheritance.  (And it doesn't seem to matter which language either.  The
> languages with fancy MI just come up with a different set of unreasonable
> inheritance trees.)

See "Predicate Dispatching: A Unified Theory of Dispatch," by Michael
D. Ernst, Craig Kaplan, and Craig Chambers, at:
 
  http://www.cs.washington.edu/research/projects/cecil/www/Papers/gud.html

>From the abstract:

  Predicate dispatching generalizes previous method dispatch mechanisms
  by permitting arbitrary predicates to control method applicability and
  by using logical implication between predicates as the overriding
  relationship. The method selected to handle a message send can depend
  not just on the classes of the arguments, as in ordinary
  object-oriented dispatch, but also on the classes of subcomponents, on
  an argument's state, and on relationships between objects. This simple
  mechanism subsumes and extends object-oriented single and multiple
  dispatch, ML-style pattern matching, predicate classes, and
  classifiers, which can all be regarded as syntactic sugar for
  predicate dispatching. This paper introduces predicate dispatching,
  gives motivating examples, and presents its static and dynamic
  semantics. An implementation of predicate dispatching is available.

The downside, of course, is that method dispatch becomes undecidable.


Neel



References: