comp.lang.ada
 help / color / mirror / Atom feed
From: Dmitry A. Kazakov <mailbox@dmitry-kazakov.de>
Subject: Re: Q: Endless loop by dispatching
Date: Wed, 23 Jul 2003 10:12:06 +0200
Date: 2003-07-23T10:12:06+02:00	[thread overview]
Message-ID: <iqeshvscuj90t1da8i0eukvqb0v8dqbrvb@4ax.com> (raw)
In-Reply-To: slrnbhql0g.oa.lutz@taranis.iks-jena.de

On Tue, 22 Jul 2003 15:11:15 +0000 (UTC), Lutz Donnerhacke
<lutz@iks-jena.de> 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



  reply	other threads:[~2003-07-23  8:12 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-11  8:22 Q: Endless loop by dispatching Michael Erdmann
2003-07-11  9:46 ` Jean-Pierre Rosen
2003-07-11 15:19   ` Michael Erdmann
2003-07-11 10:01 ` Q: " Dmitry A. Kazakov
2003-07-11 15:07   ` Michael Erdmann
2003-07-12  1:41     ` Jeffrey Carter
2003-07-14  8:48     ` Dmitry A. Kazakov
2003-07-14 18:38       ` Randy Brukardt
2003-07-15  8:47         ` Dmitry A. Kazakov
2003-07-15 17:23           ` Randy Brukardt
2003-07-16  8:08             ` Dmitry A. Kazakov
2003-07-16 17:44               ` Robert I. Eachus
2003-07-17  1:57               ` Robert A Duff
2003-07-18  9:10                 ` Dale Stanbrough
2003-07-18 20:26                   ` Robert I. Eachus
2003-07-18 21:35                     ` tmoran
2003-07-19  0:25                       ` Robert I. Eachus
2003-07-19  2:30                         ` tmoran
2003-07-19  5:48                           ` Robert I. Eachus
2003-07-21  8:38                             ` Dmitry A. Kazakov
2003-07-21 10:08                               ` Robert I. Eachus
2003-07-21 13:21                                 ` Dmitry A. Kazakov
2003-07-21 18:51                                   ` Robert I. Eachus
2003-07-22  7:41                                     ` Dmitry A. Kazakov
2003-07-22 10:36                                       ` Lutz Donnerhacke
2003-07-22 12:11                                         ` Dmitry A. Kazakov
2003-07-22 12:18                                           ` Lutz Donnerhacke
2003-07-22 14:46                                             ` Dmitry A. Kazakov
2003-07-22 15:11                                               ` Lutz Donnerhacke
2003-07-23  8:12                                                 ` Dmitry A. Kazakov [this message]
2003-07-19 14:44                     ` Chad R. Meiners
2003-07-20 12:36                       ` Robert I. Eachus
2003-07-11 16:27 ` T. Kurt Bond
2003-07-12  8:37   ` Michael Erdmann
2003-07-15  7:11     ` Kenneth Almquist
replies disabled

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