comp.lang.ada
 help / color / mirror / Atom feed
From: "Robert I. Eachus" <rieachus@attbi.com>
Subject: Re: Q: Endless loop by dispatching
Date: Wed, 16 Jul 2003 17:44:36 GMT
Date: 2003-07-16T17:44:36+00:00	[thread overview]
Message-ID: <3F158F03.5020806@attbi.com> (raw)
In-Reply-To: ep0ahv43mi0p5klonocleu2qjr1atorfdi@4ax.com

Dmitry A. Kazakov wrote:

> One should invent a good syntax suggar for this. Which is rather
> difficult. There are actually two things in it:

That is putting it VERY mildly.

> 1. There should be a way to declare some primitive operation saying
> that it cannot be overriden completely. One might wish it for things
> like Initialize/Finalize. Then probably there should be a way to say
> where an override is allowed to add something.
> 
> 2. During overriding one should specifiy where the override(s) places
> the extension. I think that it should be specified in the body, while
> the specification should only say that it gets overridden.
> 
> The question is syntax and a good balance between 1. and 2., i.e
> between contract and implementation. The most complicated cases would
> emerge from things like Adjust, I suppose.

 > It is also related to an ability to explicitly specify that a
 > subroutine is an overriding, not overloading, to avoid undesired
 > overloading in case ot typo errors. I do not know whether there is an
 > AI on that. If yes, they should be considered together.


There is an AI on this  (AI-218).  If you try to follow the discussion, 
you eyes will quickly glaze over.  It needs to be fixed, it probably 
will be fixed, but there is a slight problem.  There can be multiple 
views of a subprogram declaration, and in some views it will be 
overriding, while in others it is not.  This is both why a "confirming" 
keyword is currently the leading candidate for Ada0Y, and why it is so 
hard. We don't want a solution that requires a programmer to explicitly 
confirm the wrong view:

package P is

    type T is tagged private;

private

    type T is new Ada.Finalization.Controlled with...;

end P;

package P.Q is

   type NT is new T;

   procedure Initialize(X: in out NT); -- overriding?  Not here.

private
   -- but it is here.

   procedure Finalize(X: in out NT); -- overriding?  Yes, and here.

end P.Q;

I favor the pragma solution, because you can put the pragma at the point 
where it says "but it is here," and not confuse anyone.  Most ARG 
members seem to prefer the keyword solution, which requires an "extra" 
declaration at that point just to use the keyword.

Note that 90% of the potential uses are simple.  The other 10% are cases 
where the compiler will probably end up providing education to Ada 
programmers.  Getting that education as painless as possible is the real 
problem.

-- 

                                                        Robert I. Eachus

�In an ally, considerations of house, clan, planet, race are 
insignificant beside two prime questions, which are: 1. Can he shoot? 2. 
Will he aim at your enemy?� -- from the Laiden novels by Sharon Lee and 
Steve Miller.




  reply	other threads:[~2003-07-16 17:44 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 [this message]
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
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