Xref: utzoo comp.sys.next:8622 comp.lang.objective-c:36 Path: utzoo!attcan!uunet!wuarchive!usc!ucsd!network.ucsd.edu!weber.ucsd.edu!pbiron From: pbiron@weber.ucsd.edu (Paul Biron) Newsgroups: comp.sys.next,comp.lang.objective-c Subject: probate Summary: how to keep a sub-class from inheriting from its super-class? Message-ID: <3861@network.ucsd.edu> Date: 15 Oct 90 17:19:25 GMT Sender: news@network.ucsd.edu Reply-To: pbiron@weber.ucsd.edu (Paul Biron) Followup-To: comp.sys.next Organization: Division of Social Sciences, UCSD Lines: 27 Nntp-Posting-Host: weber.ucsd.edu I'm trying to figure out an "elegent" way to keep a sub-class from inheriting methods from its super-class. In this case, I'm making a Stack class out of the List class. Since a Stack should specifically deny "random" access to its elements, I need a way to keep it from inheriting ObjectAt:, etc. So far, all I've done is defined these kinds of methods like: - ObjectAt:(int)num { fputs ("Stack does not recognize selector ObjectAt:\n", stderr) ; kill (getpid (), SIGIO) ; } In other words, just give the same kind of message that the Obj-C runtime mechanism gives when you send an unknown message to an object. Is there a "better" way? Is there anything in the specs for Obj-C which say how this should be handled (I couldn't find it, if it is there). Paul Biron pbiron@ucsd.edu (619) 534-5758 Central University Library, Mail Code C-075-R Social Sciences DataBase Project University of California, San Diego, La Jolla, Ca. 92093