Re: OON: Experience with Eiffel?

From: Arch Robison (robison@kai.com)
Date: Tue Nov 09 1999 - 10:56:05 EST


> Do you know a list of OO languages which have built in
> support for multiple-dispatch/multimethods?
>
> I know CLOS supports multimethod but others?

I don't know of such a list. I believe Dylan had them, and now Cecil.
My impression is that Cecil is probably the best example of a modern OO language,
though I have no idea of whether its really usable. See:

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

Here's a pointer to one of their papers about multimethods:

        http://www.cs.washington.edu/research/projects/cecil/cecil/www/www/Papers/ecoop99.html

The lack of multimethods in C++ is irksome for me. Our newest compiler
framework resorts to stylized switch statements to get around the limitation.
E.g.:

    bool Operand::is_assignable( const Operand& rhs ) const {
        switch( kind() ) {
            tree_AssertOperand:
            tree_ControlOperand:
            tree_LvalueOperand:
                return is_assignable( rhs.type() );
            default:
                return false;
        }
    }

where the tree_* labels are macros that expand to case labels for whatever
classes are subclasses of *. It works, but it sure isn't OO.
                
Arch D. Robison Kuck & Associates Inc.
robison@kai.com 1906 Fox Drive
217-356-2288 ext. 56 Champaign IL 61820
Lead Developer for KAI C++ http://www.kai.com/C_plus_plus/index.html
--------------------- Object Oriented Numerics List --------------------------
* To subscribe/unsubscribe: use the handy web form at
http://oonumerics.org/oon/
* If this doesn't work, please send a note to owner-oon-list@oonumerics.org



This archive was generated by hypermail 2b29 : Wed Feb 20 2002 - 03:20:10 EST