craig@Neon.Stanford.EDU (Craig D. Chambers) (11/16/90)
On 14 Nov 90 16:18:52 GMT, chandra@mrsvr.UUCP (B. Chandramouli) said: >Replacing Inheritance with Code sharing/Reuse facilities >provided by the programming environment will work only for >cases where you have access to the source code. >You need inheritance provided by the language when you want to >subclass from a class that is part of a standard class library >provided by a vendor for which you have only the object code >and not the source. To reuse somebody's library of classes, you still need some of the original source, e.g. the class declarations of all superclasses (e.g. the header file). There have got to be ways to design the inheritance tool I'm imagining so that libraries come with enough information to fit in with the tool. Perhaps libraries without source code wouldn't be able to be inherited/transformed in all the funky ways you might like, but certainly this situation can't be any worse than what's available today; simple inheritance and method overriding wouldn't require any more of the source code than is currently required (the header file). In article <PCG.90Nov15184256@teachk.cs.aber.ac.uk> pcg@cs.aber.ac.uk (Piercarlo Grandi) writes: >What Craig Chambers is hinting at above is clearly smarter >linkers, maybe with smarter libraries, e.g. something a little better >than Ada's program library facility. Well, not exactly. I was talking more about real tools in the programming environment to specify rules for automatically copying and transforming source code written for one abstraction to construct (parts of) other abstractions. These tools could be interactive, in that potential ambiguities caused by the inheritance rules could be resolved interactively, potentially every time the programmer adds new methods to a superclass (if that's how the user has customized his inheritance tool). I'm not worried about implementation issues; I'm sure that they can be solved without too much effort. My environment support for inheritance was meant to free the language design from a complex, volatile feature (code inheritance), and support novel, user-customizable patterns of inheritance and other forms of source code transformation and automatic programming. -- Craig Chambers