comp.lang.ada
 help / color / mirror / Atom feed
From: eachus@spectre.mitre.org (Robert I. Eachus)
Subject: Re: Help - Constructors - ASAP.
Date: 1998/07/31
Date: 1998-07-31T00:00:00+00:00	[thread overview]
Message-ID: <EACHUS.98Jul31173449@spectre.mitre.org> (raw)
In-Reply-To: 35C1043E.9FFB23D0@elca-matrix.ch

   tedennison@my-dejanews.com wrote:

   > But what happens in the situation where the client (perhaps a
   > different developer) wants to make a child class with fields that
   > *must* be initialized? That seems a quite reasonable thing to
   > do. But now the class-wide "constructor" isn't valid anymore. It
   > can still be called for this new child object, but will return a
   > garbage value.

   Note that there ARE cases where you do want to have a dispatching
constructor.   In those cases you really do want to have a constructor
that is derived, and you (or someone else) will have to do the
explicit overriding.  Using records with default initial values can
make this fairly painless, but you want to have derivation trees that
are wide instead of deep.  (You can even use generics to create the
instances.)
--

					Robert I. Eachus

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




  reply	other threads:[~1998-07-31  0:00 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-07-23  0:00 Help - Constructors - ASAP Maxim Senin
1998-07-26  0:00 ` Matthew Heaney
1998-07-27  0:00   ` dennison
1998-07-30  0:00     ` Robert I. Eachus
1998-07-30  0:00       ` tedennison
1998-07-31  0:00         ` Matthew Heaney
1998-07-31  0:00         ` Mats Weber
1998-07-31  0:00           ` Robert I. Eachus [this message]
1998-08-01  0:00             ` Matthew Heaney
1998-07-31  0:00           ` dennison
1998-08-01  0:00             ` Matthew Heaney
1998-08-01  0:00             ` Robert Dewar
1998-08-01  0:00               ` Matthew Heaney
1998-08-03  0:00             ` Mats Weber
1998-08-01  0:00       ` Robert Dewar
1998-08-01  0:00         ` Matthew Heaney
1998-08-03  0:00           ` Mats Weber
1998-08-03  0:00             ` Matthew Heaney
1998-08-03  0:00               ` Mats Weber
1998-08-04  0:00                 ` Matthew Heaney
1998-08-04  0:00                   ` Mats Weber
1998-08-05  0:00                     ` Matthew Heaney
1998-08-10  0:00           ` Robert I. Eachus
1998-08-03  0:00         ` tedennison
  -- strict thread matches above, loose matches on Subject: below --
1998-07-15  0:00 Maxim Senin
1998-07-16  0:00 ` Stephen Leake
replies disabled

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