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.9 required=5.0 tests=BAYES_00, T_FILL_THIS_FORM_SHORT autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,fba93c19bb4e7dbd X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-07-22 08:11:15 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!news-FFM2.ecrc.net!news.iks-jena.de!not-for-mail From: Lutz Donnerhacke Newsgroups: comp.lang.ada Subject: Re: Q: Endless loop by dispatching Date: Tue, 22 Jul 2003 15:11:15 +0000 (UTC) Organization: IKS GmbH Jena Message-ID: References: <3F188FDA.3000202@attbi.com> <3F18DB9D.5020205@attbi.com> <818nhv0hrmlheu622t82574blao7bqr0tt@4ax.com> <3F1BBB9B.2070800@attbi.com> <3F1C360E.8010208@attbi.com> <25pphvct4bsdc5ag0rrnftoitlqgombm25@4ax.com> <3daqhvk2506mngn818ihqlsbl0ss6pd896@4ax.com> NNTP-Posting-Host: taranis.iks-jena.de X-Trace: branwen.iks-jena.de 1058886675 4284 217.17.192.37 (22 Jul 2003 15:11:15 GMT) X-Complaints-To: usenet@iks-jena.de NNTP-Posting-Date: Tue, 22 Jul 2003 15:11:15 +0000 (UTC) User-Agent: slrn/0.9.7.4 (Linux) Xref: archiver1.google.com comp.lang.ada:40648 Date: 2003-07-22T15:11:15+00:00 List-Id: * Dmitry A Kazakov wrote: > On Tue, 22 Jul 2003 12:18:57 +0000 (UTC), Lutz Donnerhacke >>If publicly defined tagged types are fixed at the private syntax element, >>there is no possibility to define dispatching procedures and functions >>afterwards. Of course, it's not a choice, because it will break existing >>programs. > > But what if I need to extend the interface by adding some new > primitive operations? Not possible in the private part. Plain and simple. package X is type T is tagged private; function Foo return T; -- Ok. private -- fix T procedure Bar(o : T); -- Fails. type T is new Ada.Finalization.Controlled with null record; -- Fails. end X; but package X is type T is tagged private; function Foo return T; private -- fix T type T is ... end X; with X; package Y is type T is new X.T with private; procedure Bar(o : T); -- Ok. private type T is new X.T with null record; end Y; with X; package Z is [...] private type T is new X.T with null record; procedure Bar(o : T); -- Ok. end Z; > Or do you mean some sort of interface freezing like Java's "final"? No.