comp.lang.ada
 help / color / mirror / Atom feed
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?
Date: 8 Jan 92 22:56:11 GMT	[thread overview]
Message-ID: <1992Jan8.225611.3226@cis.ohio-state.edu> (raw)

In article <kmmlhbINNmqt@agate.berkeley.edu>
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

             reply	other threads:[~1992-01-08 22:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1992-01-08 22:56 micro-heart-of-gold.mit.edu!wupost!zaphod.mps.ohio-state.edu!cis.ohio-sta [this message]
  -- strict thread matches above, loose matches on Subject: below --
1992-01-15 14:04 Multiple Inheritance in Ada 9X/Pointers? Guido van Rossum
1992-01-14  9:21 Jean-Pierre Rosen
1992-01-10  1:39 mole-end!mat
1992-01-09  2:59 bu.edu!rpi!zaphod.mps.ohio-state.edu!caen!uvaarpa!software.org!blakemor
1992-01-09  0:18 Paul Barton-Davis
1992-01-08 19:51 agate!tully.CS.Berkeley.EDU!hilfingr
1992-01-08 15:38 ub!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!elephant.cis.ohio-state.e
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox