comp.lang.ada
 help / color / mirror / Atom feed
From: eachus@spectre.mitre.org (Robert I. Eachus)
Subject: Re: Inheritance and initialization?
Date: 1998/07/10
Date: 1998-07-10T00:00:00+00:00	[thread overview]
Message-ID: <EACHUS.98Jul10143940@spectre.mitre.org> (raw)
In-Reply-To: 35A38A7A.93BAA6F8@tech.swh.lv

In article <35A38A7A.93BAA6F8@tech.swh.lv> Maxim Senin <maks@tech.swh.lv> writes:

  > I'm new to ADA 95, and experience some problems with it... One of
  > them is the following.

  > So, the question is: HOW CAN I INITIALIZE NEWLY CREATED OBJECT (WITH new
  > OPERATOR)???

  >	    return new KeyEvent' (src => this, eventCode =>
  >              anEventCode, keyCode => aKeyCode, mask => aMask); 

   Have you tried:

      return new (Controlled with src => this, eventCode =>
                  anEventCode, keyCode => aKeyCode, mask => aMask); 

   I haven't followed though the logic you provided to insure that
this extension aggregate is correct, but for Controlled, you have to
use extension aggregates (see RM 4.3.2, especially the second note) to
construct objects of the type since you don't know how to initialize
the Controlled part directly.

--

					Robert I. Eachus

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




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

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <35A38A7A.93BAA6F8@tech.swh.lv>
1998-07-10  0:00 ` Inheritance and initialization? Niklas Holsti
1998-07-10  0:00 ` 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