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,12301f67e4ba5adf X-Google-Attributes: gid103376,public From: bobduff@world.std.com (Robert A Duff) Subject: Re: Controlled Types & GNAT 3.09 Date: 1997/03/14 Message-ID: #1/1 X-Deja-AN: 225497010 References: <5g3s2l$174@sutton.cs.columbia.edu> <33293975.41C6@Rational.COM> Organization: The World Public Access UNIX, Brookline, MA Newsgroups: comp.lang.ada Date: 1997-03-14T00:00:00+00:00 List-Id: In article <33293975.41C6@Rational.COM>, Jerome Desquilbet 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