comp.lang.ada
 help / color / mirror / Atom feed
From: eachus@spectre.mitre.org (Robert I. Eachus)
Subject: Re: Constructor in ADA9X
Date: 10 Feb 1995 00:22:19 GMT
Date: 1995-02-10T00:22:19+00:00	[thread overview]
Message-ID: <EACHUS.95Feb9192219@spectre.mitre.org> (raw)
In-Reply-To: stt@henning.camb.inmet.com's message of Wed, 8 Feb 1995 14:42:27 GMT

In article <D3orIs.62t@inmet.camb.inmet.com> stt@henning.camb.inmet.com (Tucker Taft) writes:

  > One last point -- sometimes you don't want a constructor
  > to be inherited, because the set of parameters it takes
  > is dependent on the specific type for which it was designed.
  > If you declare the constructor in the same package as the
  > associate type T, and it returns the type T, then it *will*
  > be inherited.  One nice way to avoid undesired inheritance for
  > certain constructors is to put all such constructors in 
  > a "child" package of the package where the original type
  > is defined.  

   What Tucker said is perfectly correct, but may be misleading to
novices.  If a function has a controlling result (of a tagged type),
then it must be overridden when inherited by a non-abstract type.

   (Hmmm...  That is also pretty confusing.  What Tucker is really
saying is that in general in Ada 9X, you usually don't want to declare
constructors where they will be inherited, because the person who
declares a type derived from it may be forced to define a useless or
"junk" constructor.  You can have inherited constructors if you want,
but usually you don't want.)

   
--

					Robert I. Eachus

with Standard_Disclaimer;
use  Standard_Disclaimer;
function Message (Text: in Clever_Ideas) return Better_Ideas is...



      reply	other threads:[~1995-02-10  0:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-02-06 20:40 Constructor in ADA9X DELROEUX JEAN-YVES
1995-02-06 23:35 ` Tore Joergensen
1995-02-08  6:09   ` Kenneth Almquist
1995-02-08 16:55   ` Ray Toal
1995-02-10 13:49     ` Robert A Duff
1995-02-11 11:46       ` Stephane Barbey
1995-02-10 22:38     ` Michael Feldman
1995-02-08 14:42 ` Tucker Taft
1995-02-10  0:22   ` Robert I. Eachus [this message]
replies disabled

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