* Re: Inheritance and initialization? [not found] <35A38A7A.93BAA6F8@tech.swh.lv> @ 1998-07-10 0:00 ` Robert I. Eachus 1998-07-10 0:00 ` Niklas Holsti 1 sibling, 0 replies; 2+ messages in thread From: Robert I. Eachus @ 1998-07-10 0:00 UTC (permalink / raw) 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... ^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Inheritance and initialization? [not found] <35A38A7A.93BAA6F8@tech.swh.lv> 1998-07-10 0:00 ` Inheritance and initialization? Robert I. Eachus @ 1998-07-10 0:00 ` Niklas Holsti 1 sibling, 0 replies; 2+ messages in thread From: Niklas Holsti @ 1998-07-10 0:00 UTC (permalink / raw) To: Maxim Senin Maxim Senin wrote: > > I'm new to ADA 95, and experience some problems with it... One of them > is the following. > There seems to be a component name mismatch between GUIEvent and your aggregate: the GUIEvent component is named "code", the aggregate seems to use "eventCode": > > type GUIEvent is new EventObject with record > code : Integer; **** ... > function newKeyEvent (this : PObject; anEventCode, aKeyCode, aMask : Integer) return PKeyEvent is > begin > return new KeyEvent' (src => this, eventCode => anEventCode, ********* ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~1998-07-10 0:00 UTC | newest] Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <35A38A7A.93BAA6F8@tech.swh.lv> 1998-07-10 0:00 ` Inheritance and initialization? Robert I. Eachus 1998-07-10 0:00 ` Niklas Holsti
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox