From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,99ed97730e0f8a4b X-Google-Attributes: gid103376,public From: eachus@spectre.mitre.org (Robert I. Eachus) Subject: Re: Inheritance and initialization? Date: 1998/07/10 Message-ID: #1/1 X-Deja-AN: 370273035 References: <35A38A7A.93BAA6F8@tech.swh.lv> Organization: The Mitre Corp., Bedford, MA. Newsgroups: comp.lang.ada Date: 1998-07-10T00:00:00+00:00 List-Id: In article <35A38A7A.93BAA6F8@tech.swh.lv> Maxim Senin 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...