Christian <christians / syd.microforte.com.au> wrote:

> "Michael Schuerig" <schuerig / acm.org> wrote:
> 
> > It looks as if you're in need of multimethods such as are available in
> > Common Lisp and Dylan. Also, predicate classes and Cecil come to mind
> > (though only in a researchy mood).
> 
> Wow, you can't say that sort of thing without some references or
> explanation.

Multimethods are dispatched on the actual (runtime) types of all of
their arguments. Think of them as the dynamic version of overloaded free
functions in C++.

With predicate classes, class membership can be tied to a predicate.
It's quite some time since I looked into it in the Cecil papers, but I
presume, one could have a superclass Rectangle and a subclass Square,
where a square is a rectangle with height == width.

http://www.gwydiondylan.org/
http://www.cs.washington.edu/research/projects/cecil/

Michael

[F'up set to comp.lang.misc]

-- 
Michael Schuerig
mailto:schuerig / acm.org
http://www.schuerig.de/michael/