comp.lang.ada
 help / color / mirror / Atom feed
From: Jerome Desquilbet <jDesquilbet@Rational.COM>
To: "Alexander V. Konstantinou" <akonstan@news.cs.columbia.edu>
Subject: Re: Controlled Types & GNAT 3.09
Date: 1997/03/14
Date: 1997-03-14T00:00:00+00:00	[thread overview]
Message-ID: <33293975.41C6@Rational.COM> (raw)
In-Reply-To: 5g3s2l$174@sutton.cs.columbia.edu


Alexander,

There's a bug in GNAT, but it is not where you think. The program you
propose should write:

Main Begin ----
F1 := F2
B1 := B2
Main End ----

And that's all! Why?

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.

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.

Regards,

  Jerome.

PS: tested with Apex 2.2.2B.
______________________________________________________________________
Jerome Desquilbet                             jDesquilbet@Rational.COM
 ' ^




  parent 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 [this message]
1997-03-14  0:00   ` Robert A Duff
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