Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sun-barr!apple!agate!shelby!neon!pescadero.Stanford.EDU!philip From: philip@pescadero.Stanford.EDU (Philip Machanick) Newsgroups: comp.lang.c++ Subject: Re: Base class access: by name only? Message-ID: <1990Nov29.224455.476@Neon.Stanford.EDU> Date: 29 Nov 90 22:44:55 GMT References: <1990Nov19.012937.27283@Neon.Stanford.EDU> <59306@microsoft.UUCP> <1990Nov29.175741.116@Think.COM> Sender: news@Neon.Stanford.EDU (USENET News System) Reply-To: philip@pescadero.stanford.edu Organization: Computer Science Department, Stanford University Lines: 28 In article <1990Nov29.175741.116@Think.COM>, barmar@think.com (Barry Margolin) writes: |> In article <59306@microsoft.UUCP> jimad@microsoft.UUCP (Jim ADCOCK) writes: |> >Yes, languages that allow accessing a superclass without using its name |> >only allow single superclasses. If you have multiple superclasses you |> >need to be able to specify *which* super class -- the obvious way to do |> >this is by using the superclasses name. |> |> Not necessarily. Flavors and CLOS define a total ordering of all the |> ancestors of a flavor/class; this total ordering is defined to be |> consistent with the partial orderings specified by the orders in which the |> immediate superclasses are named in the subclass definitions. When a |> method invokes a superclass method the next flavor/class after the current |> one in the total order is chosen. (In CLOS it gets a bit more complicated |> because of multimethods, but the same basic idea is used.) |> |> I don't think these systems even provide a way to bypass the ordering and |> invoke a specific superclass's method (well, except that the data |> structures are visible, so it's possible to do just about anything). In C++, a partial ordering is used, so it would not be possible to allow an unnamed base class in some cases - just as, in some cases, a named reference to a base class is ambiguous and therefore an error. This does not mean such a feature could never be used. Back to my original question: would it be _useful_? (I was hoping for a response from someone who had actually used this feature, e.g., in Smalltalk.) -- Philip Machanick philip@pescadero.stanford.edu