comp.lang.ada
 help / color / mirror / Atom feed
From: mcsun!corton!enst!cyclope!rosen@uunet.uu.net  (Jean-Pierre Rosen)
Subject: Re: Multiple Inheritance in Ada 9X/Pointers?
Date: 14 Jan 92 09:21:06 GMT	[thread overview]
Message-ID: <1564@cyclope.enst.fr> (raw)

Two main usages of pointers in computer languages are:
1- to build dynamic structures.
2- to allocate structures whose precise size is not known at compilation time.

In Ada, usage #2 tends to disappear thanks to unconstrained array types and
discriminated records, since dynamically sized structures can now be allocated
on the stack. Usage #1 of course still remains, but it is my *unmeasured* 
feeling that usage #2 was most often the reason for using pointers. You should
therefore expect pointers to be much less frequent in Ada than in other
languages.

Of course, Ada lets you easily hide that a structure is implemented by pointers
into the depth of a package body, provided you distinguish between Abstract
data types with object semantics and those with value semantics. On the other
hand, I can't imagine how you could effectively do that in C/C++: the ultimate
representation "percolates" all the way to the end user. For example: can you
imagine you can explain someone the behaviour of strings in C/C++ without
mentionning that a string is nothing but a pointer to character?

             reply	other threads:[~1992-01-14  9:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1992-01-14  9:21 Jean-Pierre Rosen [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-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 22:56 micro-heart-of-gold.mit.edu!wupost!zaphod.mps.ohio-state.edu!cis.ohio-sta
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