Path: utzoo!utgpu!watserv1!watmath!att!linac!pacific.mps.ohio-state.edu!zaphod.mps.ohio-state.edu!think.com!barmar From: barmar@think.com (Barry Margolin) Newsgroups: comp.lang.c++ Subject: Re: Base class access: by name only? Message-ID: <1990Nov29.175741.116@Think.COM> Date: 29 Nov 90 17:57:41 GMT References: <1990Nov19.012937.27283@Neon.Stanford.EDU> <59306@microsoft.UUCP> Sender: news@Think.COM Organization: Thinking Machines Corporation, Cambridge MA, USA Lines: 22 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). -- Barry Margolin, Thinking Machines Corp. barmar@think.com {uunet,harvard}!think!barmar