Path: utzoo!attcan!uunet!cs.utexas.edu!milano!cadillac!vaughan@mcc.com From: vaughan@mcc.com (Paul Vaughan) Newsgroups: comp.lang.c++ Subject: Re: Arguments to Overloaded Operators Message-ID: <1100@cadillac.CAD.MCC.COM> Date: 8 Jun 89 16:13:00 GMT References: <11032@orstcs.CS.ORST.EDU> Sender: news@cadillac.CAD.MCC.COM Reply-To: vaughan@mcc.com (Paul Vaughan) Organization: MCC VLSI CAD Program Lines: 22 In-reply-to: budd@mist.CS.ORST.EDU (Tim Budd) Two questions: 1) Has anyone considered overloaded functions/operators that are selected not only by a match of parameter types, but also according to the return type needed in the context? That is, have multiple definitions for the same function name with differing return types. Forgive me if this has been beaten to death before. 2) In LISP Flavors and CLOS, there has been a movement away from "message passing" to generic functions. Using what is called multiple argument dispatch in CLOS, you get something like overloaded virtual functions. The functions can be "virtual" on each argument. One of the big advantages is that the distinction between member functions and other functions (overloaded or not) goes away. You no longer have a special syntax for member function invocation, pointers to member functions, or any of that, and it becomes almost transparent whether a data object is implemented as a class or not. Is anyone considering a similar movement for C++? Paul Vaughan, MCC CAD Program | ARPA: vaughan@mcc.com | Phone: [512] 338-3639 Box 200195, Austin, TX 78720 | UUCP: ...!cs.utexas.edu!milano!cadillac!vaughan