comp.lang.ada
 help / color / mirror / Atom feed
From: bobduff@world.std.com (Robert A Duff)
Subject: Re: Controlled Types & GNAT 3.09
Date: 1997/03/14
Date: 1997-03-14T00:00:00+00:00	[thread overview]
Message-ID: <E71L84.8DF@world.std.com> (raw)
In-Reply-To: 33293975.41C6@Rational.COM


In article <33293975.41C6@Rational.COM>,
Jerome Desquilbet  <jDesquilbet@Rational.COM> wrote:
>You declared:
>
>> package Foo_Controlled  is
>> 
>>    type Foo is private;
>>    procedure Initialize(F: in out Foo);
>>    procedure Adjust(F: in out Foo);
>>    procedure Finalize(F: in out Foo);
>> 
>> private
>
>[...]
>
>> end Foo_Controlled;
>
>and same kind of declaration for Bar.
>At the place you declare Initialize, Adjust and Finalize, you are in the
>partial view of the type. You simply declare subprograms, that have
>nothing to do with the inherited subprograms from Controlled, because at
>the place you declare them, the type is not known as inheriting from
>Controlled.

No, that's not right.  If the full type for Foo is controlled, then the
above Initialize overrides the controlled one, and gets called
automatically as one would expect.  Same for the Adjust and Finalize.

>Put Initialize, Adjust and Finalize in the full view (i.e. at the end of
>the private part in your example) and it will work.

No, that's not necessary.  (It might be a good idea, though -- you
probably want to prevent clients from calling Initialize and friends
explicitly.)

>PS: tested with Apex 2.2.2B.

Sounds like a bug in Apex, then.  :-(

- Bob




  reply	other threads:[~1997-03-14  0:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-03-11  0:00 Controlled Types & GNAT 3.09 Alexander V. Konstantinou
1997-03-13  0:00 ` Robert Dewar
1997-03-14  0:00 ` Pascal Ledru
1997-03-15  0:00   ` Alexander V. Konstantinou
1997-03-21  0:00     ` Jerome Desquilbet
1997-03-14  0:00 ` Jerome Desquilbet
1997-03-14  0:00   ` Robert A Duff [this message]
1997-03-14  0:00     ` Tom Moran
replies disabled

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