From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 8 Jan 92 22:56:11 GMT From: micro-heart-of-gold.mit.edu!wupost!zaphod.mps.ohio-state.edu!cis.ohio-sta te.edu!elephant.cis.ohio-state.edu!weide@bloom-beacon.mit.edu (Bruce Weide) Subject: Re: Multiple Inheritance in Ada 9X/Pointers? Message-ID: <1992Jan8.225611.3226@cis.ohio-state.edu> List-Id: In article hilfingr@tully.CS.Berkeley.EDU (Paul N. Hilfinger) writes: > > [... stuff about pointers and go-to statements ...] > >Here, likewise, the more interesting topic is "what dynamic data types >SHOULD we use for applications where we now use pointers?" > Yes, this is (part of) the question I was proposing for discussion. Thanks to Paul for phrasing it differently. Let me try again: "What abstractions should we use to replace pointers?" Another part of the question is something like, "What useful abstractions require direct use of pointers for their (efficient) implementation?" Yet another is, "What useful abstractions require CYCLIC pointer structures for their (efficient) implementation?" (This variation is related to the recent questions about the claimed need for garbage collection in any "real" language.) To give you an idea of a possible approach to answering Paul's question, consider a list ADT. This is an example of a "dynamic data type" where most people now use pointers. The problem is not so much that pointers are involved in the representation of a list, but that the functional specification of the list ADT usually lets these pointers "stick out" so the client has to be aware of them. (This is true even for list designs in languages that don't inherently involve pointers; e.g., consider Booch's list package for Ada.) What I'd argue for is that, if pointers must be used in the representation of some abstraction, then at least this fact should not be discernible to the client of that abstraction. If this is possible (it is), then the uses of pointers may be buried deep in the bowels of a software system, where (perhaps) they can be kept under control. The pointers need not percolate all the way up to higher-level abstractions. In fact, they need not percolate up at all unless there are some useful high-level abstractions that simply cannot be implemented efficiently without direct use of pointers. (Notice that an abstraction whose representation is simply based on a list ADT does NOT directly use pointers, in this situation. The code that uses the list knows nothing about the pointers that are used in the list representation.) -Bruce