Path: utzoo!news-server.csri.toronto.edu!rutgers!sun-barr!cs.utexas.edu!uunet!mcsun!corton!ilog!barbes!davis From: davis@barbes.ilog.fr (Harley Davis) Newsgroups: comp.lang.c++ Subject: Re: Lacking parameterized types and multi-methods.... Message-ID: Date: 11 Mar 91 20:06:37 GMT References: <11687@pasteur.Berkeley.EDU> <1991Mar5.215208.21511@dragon.wpd.sgi.com> Sender: davis@ilog.fr Organization: ILOG S.A., Gentilly, France Lines: 21 In-reply-to: pal@xanadu.wpd.sgi.com's message of 5 Mar 91 21:52:08 GMT In article <1991Mar5.215208.21511@dragon.wpd.sgi.com> pal@xanadu.wpd.sgi.com (Anil Pal) writes: This method of dispatching first on one argument type, then another is referred to as double-dispatching. Another way to solve the problem is to define a virtual function on Listable which returns a numeric equivalent for the object, and then compare the numbers. This avoids having to write n-squared methods; you only have to write n. Of course, it assumes that you can sensibly generate a number for every object, but I don't think that's more outrageous than comparing Names and Notes. -- Harley Davis -- ------------------------------------------------------------------------------ nom: Harley Davis ILOG S.A. net: davis@ilog.fr 2 Avenue Gallie'ni, BP 85 tel: (33 1) 46 63 66 66 94253 Gentilly Cedex, France