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 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-23 01:21:25 PST Path: archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-01!sn-xit-06!sn-xit-08!supernews.com!freenix!proxad.net!newsfeed.stueberl.de!fu-berlin.de!uni-berlin.de!tar-alcarin.cbb-automation.DE!not-for-mail From: Dmitry A. Kazakov Newsgroups: comp.lang.ada Subject: Re: Q: Endless loop by dispatching Date: Wed, 23 Jul 2003 10:12:06 +0200 Message-ID: References: <3F18DB9D.5020205@attbi.com> <818nhv0hrmlheu622t82574blao7bqr0tt@4ax.com> <3F1BBB9B.2070800@attbi.com> <3F1C360E.8010208@attbi.com> <25pphvct4bsdc5ag0rrnftoitlqgombm25@4ax.com> <3daqhvk2506mngn818ihqlsbl0ss6pd896@4ax.com> NNTP-Posting-Host: tar-alcarin.cbb-automation.de (212.79.194.111) Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de 1058947674 17126779 212.79.194.111 (16 [77047]) X-Newsreader: Forte Agent 1.8/32.548 Xref: archiver1.google.com comp.lang.ada:40683 Date: 2003-07-23T10:12:06+02:00 List-Id: On Tue, 22 Jul 2003 15:11:15 +0000 (UTC), Lutz Donnerhacke wrote: >* 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 I do need private primitive operations to implement T and note, to reuse them while implementing the types derived from T. This proposal in effect would make impossible to have both public and private operations. This will force a type designer to publish everything breaking information hiding. Just ask the question, why type T is new Ada.Finalization.Controlled with null record; was made private? The only answer is: to hide Initialize/Finalize! To my taste even 3.9.3(10) is too limiting. It should be possible to declare a private abstract primitive subprogram! For example: type T is private abstract tagged private; -- (:-)) private type T is abstract tagged ...; procedure Write_etc_passwd (This : T) is abstract; You can derive from T only in a child package. The public declaration of T shall specify this fact, of course. --- Regards, Dmitry Kazakov www.dmitry-kazakov.de